Skip to content

fix: say when a query ran past the timeout - #9

Merged
fuseraft merged 1 commit into
masterfrom
fix/timeout-message
Oct 18, 2026
Merged

fuseraft merged 1 commit into
masterfrom
fix/timeout-message

Conversation

@fuseraft

Copy link
Copy Markdown
Owner

When a query ran past App:QueryTimeoutSeconds, the agent saw only the driver's own text, which differs by database and reads like a broken connection:

Database Before
Postgres Query error: Exception while reading from stream
Oracle Query error: A task was canceled.
SQL Server Query error: Execution Timeout Expired. …
MySQL Query error: The Command Timeout expired before the operation completed.

Now all four return:

Query timed out after 30 s (App:QueryTimeoutSeconds). Narrow it with a WHERE clause or an index, or ask for fewer rows.

IsTimeout recognises each driver's timeout: Npgsql's TimeoutException inner exception, SqlClient error -2, MySqlConnector CommandTimeoutExpired, Oracle ORA-01013, and the OperationCanceledException Oracle throws. A cancel the caller asked for is still rethrown before this check, so it isn't reported as a timeout. The README's QueryTimeoutSeconds row mentions the message.

Testing

  • New test Says_when_a_query_ran_past_the_timeout, with one case per database. It uses a 1-second timeout and a query that runs longer.
  • The full suite passes against all four databases: 311 tests, 0 skipped.
  • Tried live through fuseraft's TUI: SELECT pg_sleep(40) now returns the new message.

Not covered: MySQL's SELECT SLEEP(n) returns 1 instead of an error when the timeout kills it, so that one query still looks like a success. Real queries that run too long do fail with the timeout.

Each driver reports a command timeout its own way, and the agent saw only the
driver's text: Npgsql's "Exception while reading from stream" or Oracle's
"A task was canceled." Those read as a broken connection, not a slow query.
A timeout now says so, with the setting and how to narrow the query.
@fuseraft
fuseraft merged commit e866854 into master Oct 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant