Skip to content

fix: in-flight query table is keyed by thread id alone #901

Closed

Description

@EVWorth

The executor tracks running statements in in_flight: DashMap<u64, (String, Route)> (src-tauri/crates/mas-core/src/query/executor.rs), keyed only by the server's thread id. Thread ids are unique per server, not across servers. Two open connections, to two different servers, can both have thread N running at once:

  • The second insert overwrites the first, so cancelling the first connection misses its statement.
  • InFlightGuard::drop removes by thread id regardless of connection, so one statement finishing can deregister another server's running statement. Cancel then can't reach that one either.

The ticket added in #900 checks the connection id and route before it removes its own entry. The executor's own guard and the insert collision are unchanged.

Fix

Key the table by (connection_id, thread_id). Then update threads_to_cancel, InFlightGuard::drop and the tracker to match. Add a unit test: two connections register the same thread id, and cancelling one leaves the other registered.

Found while fixing #894.

Activity

  1. added
    bug
    on Oct 25, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions