Description
- Package Name: azure.eventhub
- Package Version: 5.15.0
- Operating System: Linux
- Python Version: 3.11.4
Describe the bug
Hi there, we have a python service running that publishes some events to an event hub every few minutes. We're intercepting external logs and we're getting the following warning from time to time:
"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 '0d2b8a9ef31548df9b32154da33cc1cd_G21'.", None]"
Now, it does not seem like we have any problems with publishing events, so we assume that the connection is automatically re-created again in the background after closing it. Is that right?
We still would like to understand where this warning is coming from.
According to this documentation the idle timeout is "...by default None, meaning that the client will not shutdown due to inactivity unless initiated by the service."
To Reproduce
Steps to reproduce the behavior:
We are creating the producer client when we start our server (FastAPI))
producer = EventHubProducerClient(
fully_qualified_namespace=settings.EVENT_HUB_FULLY_QUALIFIED_NAMESPACE,
eventhub_name=settings.EVENT_HUB_NAME,
credential=credential,
)
Expected behavior
If idle_timeout is not set, the connection should not time out
Screenshots
Additional context
We saw a couple of other issues related to that. But it's not clear how it answers our question:
- The connection was inactive for more than the allowed 240000 milliseconds and is closed by container #9917
- Unexpected error ErrorCodes.ConnectionCloseForced: The connection was inactive for more than the allowed 240000 milliseconds and is closed by container azure-iot-sdk-python#947
- ampq:connection:forced disconnect due to idle. Can't set idle time. Regression bug. #34212