Azure / go-amqp

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

Replace messages channel with a queue #244

Closed jhendrixMSFT closed 1 year ago

jhendrixMSFT commented 1 year ago

The Receiver.messages channel placed an arbitrary restriction on the amount of link credit that could be issued to a Receiver. Once the Receiver has been created, it can never be issued credit that exceeds the size of the channel. In addition, if the Receiver were to receive messages that exceeds the size of the channel, due to flow control bugs or other, the writes to the channel could block leading to hangs. The channel has been replaced with a segmented FIFO queue. While this in theory could allow for unbounded growth, the reality is that the total size can never be greater than that of the Session's incoming window.

jhendrixMSFT commented 1 year ago

Partial fix for https://github.com/Azure/go-amqp/issues/240

jhendrixMSFT commented 1 year ago

Note that this is going into the flowcontrol branch which is where all of the flow control fixes will go.