Azure / go-amqp

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

Handle cancellation in places that could block #297

Closed richardpark-msft closed 1 year ago

richardpark-msft commented 1 year ago

We have a few unbuffered channels that in normal operation we expect to cycle rather quickly. However, since they can block indefinitely (unlikely, but possible) we should allow for cancellation to occur.

Most of the complications for cancel come from leaving ourselves in an inconsistent state but the spots I've added cancellation shouldn't be problematic, as they're all before network IO has occurred.

jhendrixMSFT commented 1 year ago

Do we have traces indicating a hang? If so, I'd like to get that fixed.