agronholm / agronholm/mqttproto
Race condition on connection restart
- 主要语言
- Python
- 星标
- 23
- 派生
- 6
- PR 合并指标
- 30 天内没有已合并 PR
描述
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)
```
贡献指南
评估
这个 Issue 还没有评估数据。