minghuaw / azeventhubs

Unofficial Azure Event Hubs SDK over AMQP 1.0 for rust
5 stars 2 forks source link

Improve error reporting for idling client #5

Closed minghuaw closed 9 months ago

minghuaw commented 10 months ago

Event Hub will close the producer client if it has been idling for more than 30 mins. The error message is carried in the detach frame, however, when passing the error to the user, the session error is prioritized and this will result in losing the error carried in the detach frame

minghuaw commented 9 months ago

The current error propagation is not useful in the following scenario.

A client starts up but remain idling for more than what Event Hubs allows. Then event hub closes the connection. The client tries to start reading event but end up getting a IllegalSessionState error (this doesn't trigger the recovery mechanism because it is the first time trying to read), while the true cause is that the connection is closed by the remote with an Error.

minghuaw commented 9 months ago

The retry mechanism now tries to get the connection error if retry fails