poorbarcode opened a new pull request, #25106: URL: https://github.com/apache/pulsar/pull/25106
### Motivation **Background** - Producer uses a int variable `messagesCount` to cache how many messages is in pending sending state. - Producer will resent all pending messages after reconnections, if `messagesCount`. **Root cause: `Producer.resendMessages` was skipped due to the following issue** - the client side issue causes `message.metadata.numMessagesInBatch` being `0`, such as https://github.com/streamnative/pulsar-rs/issues/376 - since `message.metadata.numMessagesInBatch` can be `0` due to client-side bugs, `producer.pendingMessages.messagesCount` will also be `0`, and lead to that the producer assumed there is no messages need to be resent. - the internal producer of replicators went to stuck state. ### Modifications `Producer.resendMessage` should only care about whether there is pending requests in `producer.pendingMessages`, It should not care about how many messages in packages. ### Documentation - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: x -- 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]
