You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Verify the superseded-navigation cancel no longer stalls the main thread over SSH #2061
#2055 moved the driver cancel for a superseded navigation off the main thread. The reasoning and the unit tests hold, but no runtime capture has actually exercised the path, so the fix is unproven in practice.
What was measured before the fix
Superseding a navigation while a query was in flight blocked the main thread. Perfect correlation across a full browsing session:
hasInFlightQuery
connection
replaceTabContent
false
either
0.1-0.2ms
true
SSH tunnel
68-157ms
true
local
0.1ms
Cause: a PostgreSQL cancel opens a second connection to deliver the request (Client connected, relaying to localhost:5432 appears at exactly that point in the trace). Through a tunnel that round trip is 70-160ms, and it was being paid synchronously.
Why it is still unproven
The capture taken after the fix does not contain a single hasInFlightQuery=true. Every supersede in that run happened during schemaColumnsBegin, before executeStarted, so no driver query existed to cancel and the new code path never ran. replaceTabContent is 0.1-4.9ms throughout, but only because nothing needed cancelling.
How to verify
Connect to a Postgres instance over an SSH tunnel.
Open a table whose query takes about a second. In the original capture analytics_events took 1.1s and orders took 1.27s.
Find the openTableTab line with hasInFlightQuery=true and read the replaceTabContent gap on the next line.
Pass: single-digit milliseconds. Fail: still 68-157ms, meaning the cancel is somehow still synchronous.
Worth also confirming the cancel still lands, since it now happens asynchronously. The superseded trace should reach END outcome=cancelled or failed:CancellationError rather than running to completion.
Related
See also #2058, which is the remaining cost on this path and is a different problem.
#2065 merged an automated guard for this: ScopedDriverCancellationTests pins that a .supersededNavigation cancel never runs on the main thread, that it still lands, that Stop stays synchronous, and that a .protectedWrite lease is never aborted.
Leaving this open on purpose. The test proves the dispatch, not the end-to-end number. Nobody has yet run the capture in the issue body against Postgres over an SSH tunnel, so the 68-157ms stall is guarded by construction but still unobserved in the field.
Worth noting from a local capture taken since: on a local connection the app-side cost between clicking a table and the query starting is ~12ms of main actor scheduling, and executeStarted to driverFetchBegin is 3-13ms with no gate wait. That is the healthy baseline to compare an SSH capture against.
Activity
datlechin commentedon Aug 10, 2026
#2065 merged an automated guard for this:
ScopedDriverCancellationTestspins that a.supersededNavigationcancel never runs on the main thread, that it still lands, that Stop stays synchronous, and that a.protectedWritelease is never aborted.Leaving this open on purpose. The test proves the dispatch, not the end-to-end number. Nobody has yet run the capture in the issue body against Postgres over an SSH tunnel, so the 68-157ms stall is guarded by construction but still unobserved in the field.
Worth noting from a local capture taken since: on a local connection the app-side cost between clicking a table and the query starting is ~12ms of main actor scheduling, and
executeStartedtodriverFetchBeginis 3-13ms with no gate wait. That is the healthy baseline to compare an SSH capture against.