-
Notifications
You must be signed in to change notification settings - Fork 67
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
[fix] Fix PartitionedProducerImpl::closeAsync to close sub-producers properly #125
Conversation
@erobot Hi, Can you add unit test based on the steps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add the unit test to avoid the regression?
ok, I will fix the code style and add a unit test latter. |
The difference is not clear from the output. Maybe a unit test would be better to tell the difference. |
Just digged deeper into this issue. I think there is no problem with the current master. If one internal producer failed to create, the partitioned producer would not be added into the Then the
|
@BewareMyPower add a test to reproduce the problem |
I got it. It's caused when some sub-producers can be created successfully while other could fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
279d6cb
to
2e4fb57
Compare
Co-authored-by: Yunze Xu <[email protected]>
Co-authored-by: Yunze Xu <[email protected]>
…properly (apache#125) ### Motivation PartitionedProducerImpl do not close sub-producers properly when any sub-producer creation fails. Continuing to retry creating producer will eventually reach the maximum producer limit. It seems a regression caused by apache#54. When sub-producer creation fails, state_ is set to Failed. PartitionedProducerImpl::closeAsync only do cleanup when state_==Ready and sub-producers do not close when state_==Failed. https://github.com/apache/pulsar-client-cpp/blob/f0268ecd29a6d0030b7d07379ec609884b4c14ff/lib/PartitionedProducerImpl.cc#L273-L276 ### Modifications Close sub-producers when state != Closed.
Motivation
PartitionedProducerImpl do not close sub-producers properly when any sub-producer creation fails. Continuing to retry creating producer will eventually reach the maximum producer limit. It seems a regression caused by #54.
When sub-producer creation fails, state_ is set to Failed. PartitionedProducerImpl::closeAsync only do cleanup when state_==Ready and sub-producers do not close when state_==Failed.
pulsar-client-cpp/lib/PartitionedProducerImpl.cc
Lines 273 to 276 in f0268ec
Modifications
Close sub-producers when state != Closed.
Verifying this change
test code:
test cmd:
test procedure:
Documentation
doc-required
(Your PR needs to update docs and you will update later)
doc-not-needed
bug-fix only
doc
(Your PR contains doc changes)
doc-complete
(Docs have been already added)