RobertIndie commented on code in PR #1256:
URL: https://github.com/apache/pulsar-client-go/pull/1256#discussion_r1694438503
##########
pulsar/consumer_partition.go:
##########
@@ -595,23 +596,28 @@ func (pc *partitionConsumer) getLastMessageID()
(*trackingMessageID, error) {
<-req.doneCh
return req.msgID, req.err
}
- for {
+
+ opFn := func() (*trackingMessageID, error) {
msgID, err := request()
if err == nil {
return msgID, nil
}
- if remainTime <= 0 {
- pc.log.WithError(err).Error("Failed to
getLastMessageID")
- return nil, fmt.Errorf("failed to getLastMessageID due
to %w", err)
- }
- nextDelay := backoff.Next()
- if nextDelay > remainTime {
- nextDelay = remainTime
- }
- remainTime -= nextDelay
- pc.log.WithError(err).Errorf("Failed to get last message id
from broker, retrying in %v...", nextDelay)
Review Comment:
Can we keep this log? So that we can see if the operation is being retried.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]