minghuaw / azeventhubs

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

Fix mgmt recovery #24

Closed minghuaw closed 9 months ago

minghuaw commented 9 months ago

This PR avoids the following issue #4 by:

  1. Checks if the management client session is ended and only attempts recovery if the management client session is already ended.
  2. Closes the existing management client and session before opening new management session and client.

[2023-12-14 20:46:01] [azeventhubs::amqp::amqp_consumer::sin gle] [ERROR] Failed to recover client: SenderResume(AttachError(RemoteClosedWithError(Error { condition: AmqpEr ror(NotAllowed), description: Some("A link to connection '40123453' $management node has already been opened.") , info: None })))

minghuaw commented 9 months ago

If session is closed, the client is definitely closed. So doing (2) is kind of redundant. The management extension is still a working draft, and thus there is no guarantee that the session will be closed together with the client. This leaves the potential for issue in the future