Azure / go-amqp

AMQP 1.0 client library for Go.
https://github.com/Azure/go-amqp
MIT License
104 stars 56 forks source link

Conn.done is closed after the close performative has been sent #281

Closed jhendrixMSFT closed 1 year ago

jhendrixMSFT commented 1 year ago

We typically select on Conn.done as a means to tell if the connection is closed. Unfortunately, Conn.done is closed after the close performative has been sent, so there's a window between the close performative and the closing of Conn.done where we think the connection is valid but it really isn't. We need to retool the logic so that once the close performative has been sent, we consider the connection to be terminated.

While the issue itself is mostly harmless, it could cause some unexpected errors to surface.

jhendrixMSFT commented 1 year ago

Dug into this some more and it's not possible. Once the close performative has been sent, connWriter() will terminate making it impossible to send frames (the observed bug that prompted this issue was something different).