mirror of
https://github.com/google/bumble.git
synced 2026-06-17 10:02:27 +00:00
5bff934868
Resolve a teardown hang in LeCreditBasedChannel. When a disconnection collision occurs (both DUT and peer call disconnect simultaneously) or the channel is aborted during disconnection, the connection state transitions to DISCONNECTED before the peer's response arrives (or is ignored). In these cases, the `disconnection_result` future remained unresolved, causing any awaiting teardown task to hang. This patch ensures that calling abort() or receiving a disconnection request while in the DISCONNECTING state correctly resolves `disconnection_result` and cleans up the channel. Verification: Verified with a new unit test `test_abort_while_disconnecting` added to `tests/l2cap_test.py` that stubs a non-responsive peer and calls abort() during the DISCONNECTING state transition, confirming it completes immediately.