kazoo icon indicating copy to clipboard operation
kazoo copied to clipboard

SASL reconnection error

Open jeblair opened this issue 5 years ago • 1 comments

When using SASL authentication, if a kazoo client is disconnected, all future API calls will return NoAuthError on reconnect.

The issue appears to be that the connection object maintains the state of the SASL request in the .sasl_cli attribute, but that is not reset on disconnection. That means that when the reconnection attempt is made, it thinks that the SASL request is already completed, so it is not performed.

I am able to temporarily work around this in my app by setting client._connection.sasl_cli = None. Perhaps something similar in the connection handling code would address the problem.

jeblair avatar Mar 10 '20 17:03 jeblair

Hi,

Thank you for your report.

Can you clarify a little bit what state transitions your client is going through when you say "disconnected"?

A SUSPENDED connection as the client transitions to a new server in the ensemble? A LOST connection that you subsequently reconnect? A stop()/start()?

Thanks,

On Tue, Mar 10, 2020, 13:02 James E. Blair [email protected] wrote:

When using SASL authentication, if a kazoo client is disconnected, all future API calls will return NoAuthError on reconnect.

The issue appears to be that the connection object maintains the state of the SASL request in the .sasl_cli attribute, but that is not reset on disconnection. That means that when the reconnection attempt is made, it thinks that the SASL request is already completed, so it is not performed.

I am able to temporarily work around this in my app by setting client._connection.sasl_cli = None. Perhaps something similar in the connection handling code would address the problem.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/python-zk/kazoo/issues/594?email_source=notifications&email_token=AAIFTHTTBF4LFQCGUXOKAGTRGZXEFA5CNFSM4LFDSOEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IT6W4IA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIFTHSNWTVGDRSOUNCFP4DRGZXEFANCNFSM4LFDSOEA .

ceache avatar Mar 10 '20 17:03 ceache