Azure / azure-uamqp-python

AMQP 1.0 client library for Python
MIT License
55 stars 47 forks source link

LinkDetach Idle timeout after 10 minutes is printed as log warning #354

Closed orle closed 11 months ago

orle commented 1 year ago

Describe the bug We use azure-eventhub==5.10.1 which uses uamqp==1.6.3.

I recently went over our error/warn logs and notice idle timeout connections are logged as warnings, although (as I see it) those exceptions are just a way to call the reconnect mechanism after 10 minutes of idle connection.

If that's in fact the case, could you please "except" those exceptions and not log (but probably still throw)? or log as info (which probably logged in the reconnect function anyway so probably can skip that)? like you did here

Example logging:

  1. LinkDetach("ErrorCodes.LinkDetachForced: The link 'G14:144172915:sender-link-dec3cc59-948c-4466-8dbd-a09096da9433' is force detached. Code: publisher(link66764). Details: AmqpMessagePublisher.IdleTimerExpired: Idle timeout: 00:10:00.") source code link

  2. ConnectionClose("ErrorCodes.ConnectionCloseForced: The connection was inactive for more than the allowed 300000 milliseconds and is closed by container 'LinkTracker'. TrackingId:bf7dad0eb0a14e1e96b911ea22b668a2_G12, SystemTracker:gateway5, Timestamp:2023-01-08T10:13:40") source code link

To Reproduce Steps to reproduce the behavior:

  1. Create a listener on event hub using above versions
  2. Don't send any messages and wait for 10 minutes
  3. Log warning should appear

Expected behavior Log warning shouldn't appear for LinkDetached aftert 10 minutes of no activity (maybe log info? or no log at all?)

Screenshots image

kashifkhan commented 1 year ago

Hi @orle, thank you for the feedback and apologies for the delay in response. My team recently published an update to the event hubs sdk, 5.11.0 where we have moved to a new all python based on amqp library. We have made these info level logs now.

For any SDK related issues please open an issue at the SDK repo