Uh oh!
There was an error while loading. Please reload this page.
Fix an unbalanced release of the producer's pending semaphore - #392
Conversation
erobot
commented
Feb 1, 2024
Some tests failed in my forked repo but can succeed in my local environment. I don't know why but seems unrelated to this PR. Failed CI job: https://github.com/erobot/pulsar-client-cpp/actions/runs/7740402401/job/21107366697
|
BewareMyPower
commented
Feb 1, 2024
Not sure if it's caused by a breaking change in Pulsar 3.1.2. The |
erobot
commented
Feb 2, 2024
I opened an empty PR and the same tests failed. |
BewareMyPower
commented
Feb 2, 2024
I see. I will take a look at these failed tests today. |
BewareMyPower
commented
Feb 2, 2024
I've confirmed it's a breaking change from Pulsar 3.1.2. After I switched from Pulsar 3.1.2 to Pulsar 3.1.1, the tests passed. |
BewareMyPower
commented
Feb 2, 2024
Could you rebase to master so that the CI won't be affected? |
196663f to
5b587d1Compareerobot
commented
Feb 3, 2024
Rebased. |
Motivation
Current code releases the producer's pending semaphore twice when batch is off and message is too big. The unbalanced release overflows the semaphore, and subsequent sends will fail with ProducerQueueIsFull.
Modifications
Remove the redundant semaphore release as the necessary release will be done in
handleFailedResult.Verifying this change
This change modified a existing test and can be verified as follows:
Documentation
doc-required(Your PR needs to update docs and you will update later)
doc-not-neededBug fix.
doc(Your PR contains doc changes)
doc-complete(Docs have been already added)