Skip to content

fix: staged writes ignore the connection's query timeout #902

Closed

Description

@EVWorth

StagedWrite::begin / begin_in (src-tauri/crates/mas-core/src/query/staged.rs) runs the agent's write without the connection's query_timeout_secs. execute_routed applies that timeout, so an ordinary statement is killed when it exceeds it. A long staged write is not: if nobody cancels it, it runs unbounded and holds its connection and locks.

Fix

Apply the same timeout execute_routed uses: wrap the statement in a timeout, or set max_execution_time for the session. On expiry, kill the thread the way the executor's timeout path does. Add a connection_lanes-style live test: a profile with a 1 s timeout and a staged SLEEP(5) write must fail with the timeout error. Correct the claim in docs/design/AI_INTEGRATION.md if it says staged writes time out.

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