[SRU] rabbit queues should expire when unused
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Ubuntu Cloud Archive |
Invalid
|
Undecided
|
Unassigned | |||
Liberty |
Fix Released
|
Undecided
|
Unassigned | |||
oslo.messaging |
Fix Released
|
Undecided
|
Dmitry Mescheryakov | |||
oslo.messaging (Ubuntu) | ||||||
Trusty |
Confirmed
|
Medium
|
Jorge Niedbalski | |||
python-oslo.messaging (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | |||
Wily |
Fix Released
|
Medium
|
Jorge Niedbalski |
Bug Description
[Description]
RabbitMQ supports queue-level TTLs as described here:
https:/
This should be used when declaring queues in order to clean up queues that are orphaned for various reasons.
This is an important complement to auto_delete queues. Queues marked auto_delete are only deleted if a consumer existed at some point, and then disconnected, resulting in zero consumers.
[Impact]
Consider the following scenario: a client declares a queue (auto_delete) and binds it to a fan out exchange, but before the client can consume from the queue, it dies.
Because there was never (and will never be) a consumer of this queue, the auto_delete logic does not fire. The queue will live forever, and will collect a copy of every message that is sent to the bound fanout exchange. Given enough published messages to the exchange, the queue will eventually consume all available memory on the broker.
This is bad and we should avoid it by setting a reasonable TTL.
[Test Case]
* Deploy a new cinder service unit
* Create a volume
* Destroy the new cinder service unit.
* List the current active queues:
rabbitmqctl -p openstack list_queues messages consumers name
811 0 q-agent-
3352 0 cinder-
3352 0 cinder-
3352 0 cinder-
3352 0 cinder-
Those queues with 0 consumers will grow and remain there forever.
After applying the patch, those queues are removed from the exchange after
10 minutes.
[Regression Potential]
* Not identified.
Changed in oslo.messaging: | |
assignee: | nobody → John Eckersberg (jeckersb) |
Changed in oslo.messaging: | |
status: | New → In Progress |
Changed in oslo.messaging: | |
assignee: | John Eckersberg (jeckersb) → Dmitry Mescheryakov (dmitrymex) |
Changed in oslo.messaging (Ubuntu): | |
status: | New → Fix Committed |
Changed in oslo.messaging (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in oslo.messaging (Ubuntu Wily): | |
status: | New → In Progress |
Changed in oslo.messaging (Ubuntu Trusty): | |
assignee: | nobody → Jorge Niedbalski (niedbalski) |
Changed in oslo.messaging (Ubuntu Wily): | |
assignee: | nobody → Jorge Niedbalski (niedbalski) |
tags: | added: kilo-backport-potential liberty-backport-potential sts |
Changed in oslo.messaging (Ubuntu): | |
importance: | Undecided → Medium |
tags: | added: sts-sru |
description: | updated |
no longer affects: | oslo.messaging (Ubuntu Wily) |
no longer affects: | oslo.messaging (Ubuntu) |
no longer affects: | python-oslo.messaging (Ubuntu Trusty) |
Changed in python-oslo.messaging (Ubuntu): | |
status: | New → Fix Committed |
Changed in python-oslo.messaging (Ubuntu Wily): | |
status: | New → Fix Committed |
Changed in python-oslo.messaging (Ubuntu): | |
importance: | Undecided → Medium |
Changed in python-oslo.messaging (Ubuntu Wily): | |
importance: | Undecided → Medium |
Changed in python-oslo.messaging (Ubuntu Wily): | |
status: | Fix Committed → In Progress |
assignee: | nobody → Jorge Niedbalski (niedbalski) |
Changed in python-oslo.messaging (Ubuntu): | |
assignee: | nobody → Jorge Niedbalski (niedbalski) |
no longer affects: | oslo.messaging (Ubuntu Trusty) |
Changed in python-oslo.messaging (Ubuntu Trusty): | |
status: | New → In Progress |
assignee: | nobody → Jorge Niedbalski (niedbalski) |
Changed in python-oslo.messaging (Ubuntu): | |
assignee: | Jorge Niedbalski (niedbalski) → nobody |
Changed in python-oslo.messaging (Ubuntu Trusty): | |
importance: | Undecided → Medium |
Changed in python-oslo.messaging (Ubuntu Wily): | |
status: | In Progress → Fix Committed |
Changed in python-oslo.messaging (Ubuntu): | |
status: | Fix Committed → Fix Released |
no longer affects: | python-oslo.messaging (Ubuntu Trusty) |
Changed in oslo.messaging (Ubuntu Trusty): | |
assignee: | nobody → Jorge Niedbalski (niedbalski) |
tags: |
added: sts-sru-done removed: sts-sru |
Reviewed: https:/ /review. openstack. org/243845 /git.openstack. org/cgit/ openstack/ oslo.messaging/ commit/ ?id=10625eed87b 4c7f980bd5cd7ca cbc4caa2dec197
Committed: https:/
Submitter: Jenkins
Branch: master
commit 10625eed87b4c7f 980bd5cd7cacbc4 caa2dec197
Author: John Eckersberg <email address hidden>
Date: Fri Nov 20 17:25:58 2015 -0500
Kombu: make reply and fanout queues expire instead of auto-delete
Right now fanout and reply queues are unconditionally created with
auto-delete flag which causes a number of problems listed in bug
1495568. Replacing auto-delete with queue expiration with some sane
timeout should fix all these issues at once.
Another problem being fixed is that auto-delete flag does not causes
the queue to be deleted if it never had consumers. An orphaned fanout
queue might appear that way and it will grow indefinitely until
somebody manually removes it. See bug 1515278 for details.
A new rabbit_ transient_ queues_ ttl config parameter is introduced which
configures the TTL for reply and fanout queues. It is a positive
integer representing timeout in seconds. By default it is set to 10
minutes. That should be enough for application to reconnect or
for server to send reply to client which already died. At the same
time, it seems that not so many messages could be accumulated in
fanout queues during that time.
DocImpact /www.rabbitmq. com/ttl. html#queue- ttl) instead transient_ queues_ ttl parameter
With this change RabbitMQ driver defines reply and fanout queues
differently comparing with the previous release: now they are defined
with queue TTL (https:/
of auto-delete flag. That helps avoid a number of issues, see commit
description for details. A new rabbit_
is defined which controls the TTL value. It is set to 10 minutes by
default. The change does not affect upgrade in any way.
Closes-bug: #1495568
Closes-bug: #1515278
Co-Authored-by: Dmitry Mescheryakov <email address hidden> 24c12d7043ec810 529a9ce57ab
Change-Id: I83a8d09dc0cdae