bschofield edited a comment on issue #437:
URL: 
https://github.com/apache/pulsar-client-go/issues/437#issuecomment-756858296


   Currently, in _batch_builder.go_, `batchContainer.Add()` returns `false` if 
the current batch container has too many bytes, but _not_ if the batch 
container has too many messages.
   
   If we change that, i.e. edit
   
       } else if bc.hasSpace(payload) {
        // The current batch is full. Producer has to call Flush() to
        return false
       }
   
   to
   
       } else if bc.IsFull() || bc.hasSpace(payload) {
        // The current batch is full. Producer has to call Flush() to
        return false
       }
   
   ...then the problem also seems to go away, without changing 
`MaxPendingMessages`.
   
   It could be the case that increasing `MaxPendingMessages` is just a band-aid 
which is causing the batch containers to hit the size limit, and the real bug 
is here.
   
   However, I'm not confident enough that this is the correct fix to send a PR 
for it. Would appreciate @merlimat or @wolfstudy taking a look if you have time.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to