oslo.messaging hangs if SASL authentication fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.messaging |
Fix Released
|
Undecided
|
Ken Giusti |
Bug Description
I appear to have an invalid sasl configuration locally. This is a separate issue, however, it causes a couple of tests to fail *by timing out*. These tests are:
oslo_
oslo_
Checking the failure tests, notice that the failure case is:
Sure enough, if you remove the timeout argument it also hangs. I would expect this to fail rather than hang.
Changed in oslo.messaging: | |
assignee: | nobody → Ken Giusti (kgiusti) |
Changed in oslo.messaging: | |
assignee: | Ken Giusti (kgiusti) → Davanum Srinivas (DIMS) (dims-v) |
status: | New → In Progress |
Changed in oslo.messaging: | |
assignee: | Davanum Srinivas (DIMS) (dims-v) → nobody |
status: | In Progress → Triaged |
tags: | added: amqp1 |
Just as an aside - I believe this behavior is not limited to the amqp1 driver.
Playing a bit with oslo.messaging 2.7.0 and rabbitmq, I get the same hang if I configure an incorrect password. The client just keeps attempting to reconnect indefinitely.
Unlike the amqp1 driver, the rabbitmq driver supports an optional "retry" parameter. This integer parameter limits the total number of connection attempts, and will raise a MessageDelivery Failure exception if the connection does not succeed before the retry limit is hit.
While this can be used to prevent infinite retries, I don't think it's the proper way oslo.messaging should deal with authentication errors. If a client can't authenticate with any of its configured hosts there's no resolving that without intervention from meatspace. Raising a hard failure would get the operator's attention way faster than client hangs and log messages.
I've intended to add 'retry' to the amqp1 driver (https:/ /bugs.launchpad .net/oslo. messaging/ +bug/1434540) fyi.