-
Notifications
You must be signed in to change notification settings - Fork 70
Fix an unbalanced release of the producer's pending semaphore #392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
|
Not sure if it's caused by a breaking change in Pulsar 3.1.2. The |
I opened an empty PR and the same tests failed. |
I see. I will take a look at these failed tests today. |
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. |
Could you rebase to master so that the CI won't be affected? |
196663f
to
5b587d1
Compare
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-needed
Bug fix.
doc
(Your PR contains doc changes)
doc-complete
(Docs have been already added)