-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
- Package Name: azure-servicebus
- Package Version: 7.11.1
- Operating System: macOS/ubuntu
- Python Version: 3.8, 3.9, 3.10
Describe the bug
After resolving #29961 we've updated servicebus to 7.11.1 and now we're not seeing END frame errors like we used to, but instead we're seeing a lot of Connection closed with error: [b'amqp:connection:forced', b"The connection was inactive for more than the allowed 240000 milliseconds and is closed by container 'de9c0655b1684a31b24a94d4a733ed5e_G4S2'.", None] errors. That definitely is coming from
azure-sdk-for-python/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_connection.py
Lines 478 to 485 in ee85ddd
| if frame[0]: | |
| self._error = AMQPConnectionError( | |
| condition=frame[0][0], description=frame[0][1], info=frame[0][2] | |
| ) | |
| _LOGGER.error( | |
| "Connection closed with error: %r", frame[0], | |
| extra=self._network_trace_params | |
| ) |
I'm not sure whether this should be considered an error message, but I don't really understand how this amqp protocol works.
I want to be clear about one thing that may have something to do with it: we create an instance of ServiceBusClient and use it outside of context manager, and the same for topic or queue senders. The reason for this approach is performance - we prefer connection being closed due to inactivity over manual connection closing (like with calling close or context manager). This seems reasonable to us, because other solution would be to initialize service bus worker thread that would monitor connection time and send messages asynchronously.
Most errors coming from 3rd party libraries I treat as something I should probably take care of or there is an issue I should resolve somehow. In this case, I don't think I could do anything more, so on one hand I would silence this logger, but other error may occur that I wouldn't know about.
I would be very grateful for your support 🙏
To Reproduce
Steps to reproduce the behavior:
- Probably leaving a connection hanging with no traffic for more than 240000 milliseconds
Expected behavior
Dunno, maybe this shouldn't be considered error? Just a warning that service was disconnected would be sufficient.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
We talked with @kashifkhan in #29961.
#29961 (comment)
#29961 (comment)
#29961 (comment)
#29961 (comment)