You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Producer synchronous retries can cause retry sendAsync future to never complete #25201
I searched in the issues and found nothing similar.
Read release policy
I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
User environment
master
Issue Description
There is a reentrancy bug in the Pulsar producer send path where pendingMessages.clear() can be executed after a retry message has already been added to pendingMessages. This results in the retry send’s CompletableFuture never being completed.
This can occur when a retry sendAsync is triggered synchronously from within a handleSync callback of a failed send, while holding the producer mutex.
This happens in the failPendingMessages method which usually runs on the timer thread.
As the pendingMessages.clear() is after the completeExceptionally, the retry logic as the code below will add the retryMessage to pendingMessages first and then the clear is called.
Activity
lhotari commentedon Feb 4, 2026
There's also #19568 which has been reported against 2.9 . I'm not sure if it's related since in that case there's a thread deadlock.