We are using aiomqtt to connect to AWS IoT Core with client certificate and just in time registration, this means first connection to broker will fail with an Operation Timed out exception from line client.py: __aenter__().await self._wait_for(self._connected, timeout=None). We have the following retry logic, but we continuously get "MqttReentrantError" exception for following iterations since self._lock is not released and self._connected future is not re-initialized for the second call.
while True:
try:
async with client:
...
The following change in client.py: __aenter__() solved the problem.
We are using aiomqtt to connect to AWS IoT Core with client certificate and just in time registration, this means first connection to broker will fail with an
Operation Timed out
exception from lineclient.py: __aenter__().await self._wait_for(self._connected, timeout=None)
. We have the following retry logic, but we continuously get "MqttReentrantError" exception for following iterations sinceself._lock
is not released andself._connected
future is not re-initialized for the second call.The following change in
client.py: __aenter__()
solved the problem.