Repository navigation
fix: say when a query ran past the timeout - #9
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:Query error: Exception while reading from streamQuery error: A task was canceled.Query error: Execution Timeout Expired. …Query error: The Command Timeout expired before the operation completed.Now all four return:
IsTimeoutrecognises each driver's timeout: Npgsql'sTimeoutExceptioninner exception, SqlClient error -2, MySqlConnectorCommandTimeoutExpired, Oracle ORA-01013, and theOperationCanceledExceptionOracle throws. A cancel the caller asked for is still rethrown before this check, so it isn't reported as a timeout. The README'sQueryTimeoutSecondsrow mentions the message.Testing
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.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.