Skip to content
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

The prefetch_count parameter is not applied #223

Closed
abompard opened this issue Jul 28, 2020 · 0 comments · Fixed by #224
Closed

The prefetch_count parameter is not applied #223

abompard opened this issue Jul 28, 2020 · 0 comments · Fixed by #224

Comments

@abompard
Copy link
Member

On the server, all consumers seem to have a prefetch_count set to 0 (no limit) regardless of the configuration value.

According to the RabbitMQ docs, they changed the semantics of the global QoS parameter, and setting it to True as we've done does not enforce the prefetch limit on all channels in the connection but rather on all consumers in the channel. There is no way to have connection-wide limits with RabbitMQ.

The thing is: we create a new channel for each consumer. Therefore the QoS that was set in the main channel does not get applied to the consumer's channel, so it's always limitless. We need to make a basic_qos call after setting up the consumer channel.

abompard added a commit to abompard/fedora-messaging that referenced this issue Jul 29, 2020
According to [the RabbitMQ
docs](https://www.rabbitmq.com/consumer-prefetch.html), they changed the
semantics of the `global` QoS parameter, and setting it to `True` as
we've done does not enforce the prefetch limit on all channels in the
connection but rather on all consumers in the channel. There is no way
to have connection-wide limits with RabbitMQ.

Since we create a new channel for each consumer, we must set the QoS in
this channel and not in the main channel, otherwise it'll always be
limitless.

Fixes fedora-infra#223

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
abompard added a commit that referenced this issue Aug 4, 2020
According to [the RabbitMQ
docs](https://www.rabbitmq.com/consumer-prefetch.html), they changed the
semantics of the `global` QoS parameter, and setting it to `True` as
we've done does not enforce the prefetch limit on all channels in the
connection but rather on all consumers in the channel. There is no way
to have connection-wide limits with RabbitMQ.

Since we create a new channel for each consumer, we must set the QoS in
this channel and not in the main channel, otherwise it'll always be
limitless.

Fixes #223

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant