-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Consumers blocked with 0 availablePermits #100
Comments
I'm going to be out for the next few days. @rdhabalia can you take a look at this? |
Also, I can't think of any simple way of solving this right now, maybe we can keep track of messages in the queue on a separate set. |
redeliverUnacknowledgedMessages : it cleans up all the messages present into However, right redeliverUnacknowledgedMessages doesn't clean up
Yes, we have to make similar change of redeliverUnacknowledgedMessages to clean up from |
I will make changes and add test-cases for this scenario. |
@rdhabalia I just created a PR for this, please give it a look, perhaps you can think of a better way of approaching this. |
Ok. thanks, I will look into it. |
@merlimat @rdhabalia any news on this? We really need to solve this issue |
@sschepens just got back in office. reviewing the PRs |
Just to clarify, this issue was introduced when tracking timeout on messages not pulled from the queue. |
OK, it looks like it would be easier to just empty the queue and have the broker resend the all the messages that were on it. Anyway, they're not going to be "duplicates" since the application would not have seen them already. |
Yup, but we maybe should make the consumer not receive messages until it resumes acks. Just to prevent constant redelivery. |
I agree on that, the library should be playing with the permits to do that, but I'd keep it separate from this PR, because:
|
Fixed in #101 |
* Add multi topic consumer. * Remove unused lock.
in PR apache#82, structure is refined, but publish.sh leaked the change. * fix publish.sh for dir refine * delete integrations/__init__.py * ignore dir dev in script
When a consumer with
ackTimeout
connects, it negotiates a given amount of permits with broker (say 1000), it then receives 1000 messages. At this point the consumer has 0availablePermits
and 1000unackedMessages
, If no one pulls these messages from this consumer, they are eventually redelivered to the broker, now the broker schedules redelivery of those messages, but never incrementsavailablePermits
for the consumer, leaving the consumer stuck with 0availablePermits
.This happens at least with perMessageRedelivery, as a redelivery does not necessarily imply that permits have to be granted to the consumer. Unfortunately, I don't know if the Broker can really do something here.
I believe this issue is a consequence of a consumer asking for redelivery of messages that have never been pulled from the queue.
The best approach seems to be for the consumer to ask for more permits when this is the case.
What do you think?
The text was updated successfully, but these errors were encountered: