l2cap: Resolve teardown hang on disconnect collision or abort#937
Draft
uier wants to merge 2 commits into
Draft
Conversation
da093ad to
ab024b9
Compare
…ze and setting asyncio_mode
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: 1. 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. 2. Verified that the Google3 test target `//third_party/py/bumble:tests/l2cap_test` builds and passes. 3. Verified that the physical Mobly test target `//wireless/android/pixel/bluetooth/testing/tests/cts_v:l2cap_coc_server_test_mpt` now runs to completion on connected devices without hanging. TAG=agy CONV=30ac9cde-ad7a-4570-9bc6-5da55df17fc7
ab024b9 to
5464d43
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_resultfuture 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_resultand cleans up the channel.Verification:
Verified with a new unit test
test_abort_while_disconnectingadded totests/l2cap_test.pythat stubs a non-responsive peer and calls abort() during the DISCONNECTING state transition, confirming it completes immediately.