Skip to content

[P1][bug] query_timeout_secs column exists on profile but is never enforced #283

Closed

Description

@EVWorth

Context

DESIGN_REQUIREMENTS §FR-2.2.7: "Configurable per-connection query timeout (default: 30s); visual countdown; timeout can be overridden per execution".

Problem

ConnectionProfile.query_timeout_secs is in the migration and on the wire; ConnectionDialog.tsx exposes the field; the UI displays a countdown. But QueryExecutor::execute_owned never reads it — the column is purely cosmetic. A 600s SELECT SLEEP(...) runs to completion unchallenged (or until client timeout fires).

Files

  • src-tauri/crates/mas-core/src/models/connection.rs (query_timeout_secs column)
  • src-tauri/crates/mas-core/src/query/executor.rs (no timeout check)
  • src/components/connection/ConnectionDialog.tsx (UI field, no enforcement)

Repro

  1. Profile with query_timeout_secs = 2.
  2. Run SELECT SLEEP(10).
  3. Result returns after 10s, not 2s.

Expected

Server returns timeout error at the configured limit. UI shows countdown, then "Query timed out".

Proposed fix

Scope M. Wrap sqlx::raw_sql(...).fetch_many(&pool) in tokio::time::timeout(Duration::from_secs(timeout_secs), ...). On timeout, send KILL QUERY and return CoreError::Timeout. UI countdown pulls from server-emitted progress events.

Acceptance

SELECT SLEEP(10) against query_timeout_secs=2 returns within 2s with a timeout error. Test test_query_timeout passes.

Needs human verify

Yes.

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/editor
    on Jul 24, 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

    area/editorauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions