Azure / go-amqp

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

Don't swallow unrecognized link handles #259

Closed jhendrixMSFT closed 1 year ago

jhendrixMSFT commented 1 year ago

Per spec section 2.8.17, the session must be terminated.

Fixes https://github.com/Azure/go-amqp/issues/182

jhendrixMSFT commented 1 year ago

This has highlighted a potential deadlock in the error handling for session mux. In this case, the mux first receives a mismatched attach frame, so it shoves an &Error{} into the s.close channel. On the next iteration, the select on s.close and s.rx choses s.rx which reads yet another invalid frame. Unfortunately, s.close is full so the mux hangs.