Azure / azure-uamqp-python

AMQP 1.0 client library for Python
MIT License
57 stars 48 forks source link

handle connection discarding in sending #225

Closed yunhaoling closed 3 years ago

yunhaoling commented 3 years ago

this majorly addresses the issue that sending while in connection discarding state, previously connection would internally loop (from DISCARDING to DISCARDING) until socket finally fails.

now as we moved the connection dowork at the front of _client_run in send client so we're able to detect the DISCARDING state in advance and raise error for backward compatibility and improvement on the flow.

besides. according to AMQP spec, DISCARDING is a variant of CLOSE_SENT and TCP should close for write