Skip to content

CoreBluetooth: concurrent connect/disconnect/discover drop the earlier caller's future #488

Description

@qdot

src/corebluetooth/internal.rs connect_peripheral (~L1117), disconnect_peripheral (~L1130), and discover_services (~L1497) store the reply future in a single Option slot (connected_future_state, disconnected_future_state, services_discovered_future_state). A second concurrent call overwrites the slot, so the first caller's future is dropped without a reply and its .await hangs forever.

Failure scenario: two tasks call peripheral.connect() concurrently; one of them never returns.

Fix direction: either queue waiters (e.g. Vec/VecDeque and resolve all) or immediately error the superseded future.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcorebluetooth (macos/ios)Issues related to the MacOS/iOS CoreBluetooth impl

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions