{"record":{"id":"6a41a078a98889c5","repo":"risingwavelabs/risingwave","slug":"reject-query-the-0-query-number-reaches-the-lim","errorCode":null,"errorMessage":"Reject query: the {0} query number reaches the limit: {1}. Use `SHOW PROCESSLIST` to check for hanging queries and cancel them if needed.","messagePattern":"Reject query: the (.+?) query number reaches the limit: (.+?)\\. Use `SHOW PROCESSLIST` to check for hanging queries and cancel them if needed\\.","errorType":"exception","errorClass":"SchedulerError","httpStatus":null,"severity":"warning","filePath":"src/frontend/src/scheduler/error.rs","lineNumber":46,"sourceCode":"\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]\n        ConnectorError,\n    ),\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/scheduler/error.rs#L28-L64","documentation":"SchedulerError::QueryReachLimit is raised by the frontend admission control when the number of concurrent (or queued) queries of a given QueryMode (local/distributed) reaches the configured limit. The query is rejected before execution, and the message suggests using `SHOW PROCESSLIST` to find hanging queries.","triggerScenarios":"Submitting a new query while the count of running queries for the mode reaches the session-level limit configured via `SET QUERY_MODE_MAX_CONCURRENT_QUERIES`-style session config (default 12 per mode).","commonSituations":"Many concurrent dashboards/jobs hammering RisingWave; a hung query leaking and holding a slot until the limit is exhausted; load tests exceeding configured concurrency.","solutions":["Run `SHOW PROCESSLIST` and cancel hanging/stale queries with `CANCEL QUERIES <query_id>` to free slots.","Wait for existing queries to finish, or add client-side throttling/connection pooling limits.","Raise the concurrency limit: `SET query_mode_max_concurrent_queries = <n>` (per mode via corresponding session config).","Investigate why queries hang — often a slow compute node or an unbounded query blocking slots."],"exampleFix":"-- before: rejected at default limit\n-- after\nSET query_mode_max_concurrent_queries = 32;\nSELECT ...;","handlingStrategy":"validation","validationCode":"-- check current concurrency before submitting\nSHOW PROCESSLIST; -- compare count against SHOW PARAMETERS LIKE 'query_mode_max_concurrent_queries';","typeGuard":null,"tryCatchPattern":"// catch rejection, wait, retry\ncatch (e) { if (e.message.includes('Reject query')) { await sleep(jitter); retry(); } else throw e; }","preventionTips":["Run SHOW PROCESSLIST regularly and cancel hung queries","Throttle clients via connection pooling","Raise query_mode_max_concurrent_queries when load justifies it","Investigate queries that hang and hold admission slots"],"tags":["frontend","scheduler","rate-limit","concurrency"],"backgroundTag":"rate-limit-exceeded","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"}