{"record":{"id":"6bbf5fb2b6368a11","repo":"vectordotdev/vector","slug":"servicesink-service-sender-dropped","errorCode":null,"errorMessage":"ServiceSink service sender dropped.","messagePattern":"ServiceSink service sender dropped\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/sinks/util/sink.rs","lineNumber":482,"sourceCode":"                        });\n                    }\n                    _ => {} // do nothing\n                }\n\n                // If the rx end is dropped we still completed\n                // the request so this is a weird case that we can\n                // ignore for now.\n                _ = tx.send(());\n            })\n            .instrument(info_span!(\"request\", %request_id).or_current())\n            .boxed()\n    }\n\n    fn poll_complete(&mut self, cx: &mut Context<'_>) -> Poll<()> {\n        while !self.in_flight.is_empty() {\n            match ready!(Pin::new(&mut self.in_flight).poll_next(cx)) {\n                Some(Ok(())) => {}\n                Some(Err(_)) => panic!(\"ServiceSink service sender dropped.\"),\n                None => break,\n            }\n        }\n\n        Poll::Ready(())\n    }\n}\n\nimpl<S, Request> fmt::Debug for ServiceSink<S, Request>\nwhere\n    S: fmt::Debug,\n{\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        f.debug_struct(\"ServiceSink\")\n            .field(\"service\", &self.service)\n            .finish()\n    }\n}","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/sinks/util/sink.rs#L464-L500","documentation":"ServiceSink::poll_complete panics when an in-flight request future completes with Err, which in this driver means the bounded service sender (mpsc) was dropped while requests were outstanding. The sink assumes the spawned service task stays alive for the sink's lifetime; its disappearance is treated as an unrecoverable internal failure. The original service error was collapsed into the channel-closed error, so the root cause is the service task dying (often a panic or shutdown in the service stack).","triggerScenarios":"The inner Tower service task panics or exits while ServiceSink still has requests in flight; the sink's service sender is dropped during driver teardown out of order.","commonSituations":"A panic deeper in the sink's service stack (e.g. serialization error) tears down the service task; improper shutdown sequencing in custom drivers or during vector reload/shutdown races.","solutions":["Look for an earlier panic/error log from the inner service task — that is the real root cause","Fix the underlying service failure (e.g. encoding, network) that killed the task","If seen in custom code, keep the service alive until all in-flight futures resolve, and drain the sink before dropping"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify the inner service task is alive before driving the sink\nassert!(!service_handle.is_finished(), \"service task must outlive ServiceSink\");","typeGuard":null,"tryCatchPattern":"// Catch the upstream service failure that kills the task:\nmatch sink_future.await {\n    Ok(()) => {},\n    Err(e) => error!(error = %e, \"sink driver failed; check inner service task panic\"),\n}","preventionTips":["Keep the service task alive until all in-flight requests complete","Drain/flush the sink before shutdown","Investigate any earlier panic in the service stack — it is the root cause"],"tags":["rust","async","sink","panic","lifecycle"],"backgroundTag":"internal-invariant-violation","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}