{"record":{"id":"608e5a628d176ea6","repo":"tikv/tikv","slug":"streaming-request-is-not-supported-for-this-handle","errorCode":null,"errorMessage":"streaming request is not supported for this handler","messagePattern":"streaming request is not supported for this handler","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/coprocessor/mod.rs","lineNumber":170,"sourceCode":"                    partial_response: Box::new(response),\n                }),\n            },\n        }\n    }\n}\n\n/// An interface for all kind of Coprocessor request handlers.\n#[async_trait]\npub trait RequestHandler: Send {\n    /// Processes current request and produces either a ready response or a\n    /// result kept unserialized for merging.\n    async fn handle_request(&mut self) -> Result<HandlerOutput> {\n        panic!(\"unary request is not supported for this handler\");\n    }\n\n    /// Processes current request and produces streaming responses.\n    async fn handle_streaming_request(&mut self) -> HandlerStreamStepResult {\n        panic!(\"streaming request is not supported for this handler\");\n    }\n\n    /// Collects scan statistics generated in this request handler so far.\n    fn collect_scan_statistics(&mut self, _dest: &mut Statistics) {\n        // Do nothing by default\n    }\n\n    /// Collects scan executor time in this request handler so far.\n    fn collect_scan_summary(&mut self, _dest: &mut ExecSummary) {\n        // Do nothing by default\n    }\n\n    fn into_boxed(self) -> Box<dyn RequestHandler>\n    where\n        Self: 'static + Sized,\n    {\n        Box::new(self)\n    }","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/tikv/tikv/blob/78aedc1c81ef3f7d8bacc6e9d09f56460f134937/src/coprocessor/mod.rs#L152-L188","documentation":"The `RequestHandler` trait's default `handle_streaming_request` in src/coprocessor/mod.rs:170 panics for the mirror reason of error 357: it is a default only for unary handlers. Calling the streaming entry point on a handler that only overrides `handle_request` reaches this panic.","triggerScenarios":"Dispatching a streaming coprocessor request to a unary-only handler — the dispatcher calls handle_streaming_request on a handler that never overrides it.","commonSituations":"Sending a streaming-style request type (e.g. via the streaming gRPC path) for a handler that only supports unary; new handler implementations missing the streaming override; endpoint routing mistakes.","solutions":["Route the request through handle_request instead of handle_streaming_request for unary handlers.","If the handler should support streaming, override handle_streaming_request in your implementation.","Review the coprocessor endpoint's method selection to ensure request kind matches handler capability."],"exampleFix":"// before\nlet step = handler.handle_streaming_request().await; // unary-only handler panics\n// after\nlet output = handler.handle_request().await; // dispatch unary handlers via handle_request","handlingStrategy":"type-guard","validationCode":"// Dispatch only streaming-capable handlers through handle_streaming_request\nif !handler.supports_streaming() {\n    return dispatch_unary(handler);\n}","typeGuard":"fn supports_streaming<H: RequestHandler>(_: &H) -> bool {\n    H::SUPPORTS_STREAMING\n}","tryCatchPattern":null,"preventionTips":["Override handle_streaming_request in any handler that supports streaming.","Route requests by request kind (unary vs streaming) at the endpoint layer.","Document per-handler capabilities to prevent misrouting during refactors."],"tags":["rust","panic","coprocessor","trait-default"],"backgroundTag":"unsupported-request-mode","analyzedSha":"78aedc1c81ef3f7d8bacc6e9d09f56460f134937","analyzedAt":"2026-09-03T23:31:32.398Z","contentChangedAt":"2026-09-03T23:31:32.398Z","schemaVersion":2},"datasetVersion":"2026-09-11T07:07:21.782Z"}