{"record":{"id":"6ce087527a6835bd","repo":"risingwavelabs/risingwave","slug":"query-cancelled-0","errorCode":null,"errorMessage":"Query cancelled: {0}","messagePattern":"Query cancelled: (.+?)","errorType":"exception","errorClass":"SchedulerError","httpStatus":null,"severity":"warning","filePath":"src/frontend/src/scheduler/error.rs","lineNumber":43,"sourceCode":"pub enum SchedulerError {\n    #[error(\"Pin snapshot error: {0} fails to get epoch {1}\")]\n    PinSnapshot(QueryId, u64),\n\n    #[error(transparent)]\n    RpcError(\n        #[from]\n        #[backtrace]\n        RpcError,\n    ),\n\n    #[error(\"{0}\")]\n    TaskExecutionError(String),\n\n    #[error(\"Task got killed because compute node running out of memory\")]\n    TaskRunningOutOfMemory,\n\n    /// Used when receive cancel request for some reason, such as user cancel or timeout.\n    #[error(\"Query cancelled: {0}\")]\n    QueryCancelled(String),\n\n    #[error(\n        \"Reject query: the {0} query number reaches the limit: {1}. Use `SHOW PROCESSLIST` to check for hanging queries and cancel them if needed.\"\n    )]\n    QueryReachLimit(QueryMode, u64),\n\n    #[error(transparent)]\n    BatchError(\n        #[from]\n        #[backtrace]\n        BatchError,\n    ),\n\n    #[error(transparent)]\n    Connector(\n        #[from]\n        #[backtrace]","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/scheduler/error.rs#L25-L61","documentation":"SchedulerError::QueryCancelled(String) is produced when a running query receives a cancel request — either explicit user cancellation (Ctrl+C / CANCEL QUERIES), a session timeout, or an internal shutdown. The message includes the reason string supplied by the cancelling party.","triggerScenarios":"User issues `CANCEL QUERIES`/closes the connection while the query runs; a query timeout fires; the frontend or scheduler shuts down active queries; the compute task is cancelled due to upstream failure.","commonSituations":"Client drivers aborting on statement_timeout; operators manually cancelling long-running/hanging queries seen in `SHOW PROCESSLIST`; session termination.","solutions":["Inspect the reason text in the error and `SHOW PROCESSLIST` to see who/what cancelled the query.","If a timeout cancelled it, raise the client/statement timeout and re-run.","Re-issue the query unless it was cancelled intentionally.","Avoid killing queries accidentally: check for automated cancel jobs or idle-session timeouts in your connection pool settings."],"exampleFix":"// raise client timeout (psql/JDBC example)\nSET statement_timeout = '10min'; -- before: default that cancelled the query","handlingStrategy":"try-catch","validationCode":"-- check for other sessions' cancel activity before long runs\nSELECT * FROM SHOW PROCESSLIST;","typeGuard":null,"tryCatchPattern":"// detect cancellation and re-issue or abort cleanly\ncatch (e) { if (e.message.startsWith('Query cancelled:')) { log(reason); optionallyRetry(); } else throw e; }","preventionTips":["Set client statement timeouts larger than expected query duration","Coordinate with operators before cancelling queries","Avoid long-running interactive queries on shared clusters","Configure connection pools not to kill idle in-flight statements"],"tags":["frontend","scheduler","cancel","timeout"],"backgroundTag":"request-timeout","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}