Azure / azure-amqp

AMQP C# library
Other
94 stars 70 forks source link

Avoid race condition when canceling #202

Closed JoshLove-msft closed 2 years ago

JoshLove-msft commented 2 years ago

If the token was canceled before ReceiveAsyncResult was finished being constructed, the waiterlist would not be properly cleaned up.

Moved into the Intialize method that is already used for setting up the timer.

Also updated the receive cancellation tests to assert that a TCE is thrown.

JoshLove-msft commented 2 years ago

/cc @xinchen10 @jsquire