agronholm / agronholm/mqttproto

Race condition on connection restart

Aperta
#18 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
23
Fork
6
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

This can happen when the connection is broken either without a Disconnect packet from the server, or when trio's subtask execution order causes the loop in `_manage_connection` to restart while the disconnect packet is still in the input buffer, unprocessed.

```
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/src/mqttproto/src/mqttproto/async_client.py", line 339, in _manage_connection
| await self._do_handshake()
| File "/src/mqttproto/src/mqttproto/async_client.py", line 347, in _do_handshake
| self._state_machine.connect(
| File "/src/mqttproto/src/mqttproto/client_state_machine.py", line 110, in connect
| self._out_require_state(MQTTClientState.DISCONNECTED)
| File "/src/mqttproto/src/mqttproto/_base_client_state_machine.py", line 188, in _out_require_state
| raise MQTTProtocolError(
| mqttproto.MQTTProtocolError: cannot perform this operation in the CONNECTED state (must be in one of the following states: DISCONNECTED)
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.