Skip to content

[P0][bug] EXPLAIN ANALYZE has no timeout — runs the actual query, can hang indefinitely on production #420

Closed

Description

@EVWorth

Context

EXPLAIN ANALYZE runs the actual query to gather timing/cost data.

Problem

src/stores/resultStore.ts:118-136 (executeExplainAnalyze) has no timeout. EXPLAIN ANALYZE executes the query. executeQuery honors query_timeout_secs per editor F3 — but the column is never enforced in the executor. So EXPLAIN ANALYZE on a 10-minute query hangs for 10 minutes with no cancel. The QueryToolbar Cancel button (cancelActiveQuery) bumps a JS counter but doesn't actually cancel — see editor F1.

Files

  • src/stores/resultStore.ts:118-136

Repro

  1. Open query tab, type SELECT SLEEP(120)
  2. Click Explain → EXPLAIN ANALYZE
  3. UI hangs for 2 minutes, no cancel button on the EXPLAIN panel, no timeout

Expected

EXPLAIN ANALYZE on SELECT SLEEP(120) returns an error within 60s.

Proposed fix

Until editor F1 lands (real cancel) and editor F3 lands (timeout enforcement), hardcode a 60-second timeout in executeExplainAnalyze and surface "EXPLAIN ANALYZE timed out after 60s" error. Once those land, wire up real cancel + timeout. Scope: L (depends on editor F3 + F1).

Acceptance

EXPLAIN ANALYZE on SELECT SLEEP(120) returns an error within 60s.

Needs human verify

yes

Doc drift

no

Activity

  1. added
    audit
    severity/p0
    kind/bug
    area/explain
    on Jul 31, 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/explainauditkind/bugseverity/p0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions