{"record":{"id":"92fffc9def66f0f9","repo":"vectordotdev/vector","slug":"input-channel-should-not-be-closed","errorCode":null,"errorMessage":"input channel should not be closed","messagePattern":"input channel should not be closed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/validation/runner/mod.rs","lineNumber":578,"sourceCode":"\nfn spawn_input_driver(\n    input_events: Vec<TestEvent>,\n    input_tx: Sender<TestEvent>,\n    runner_metrics: &Arc<Mutex<RunnerMetrics>>,\n    mut maybe_encoder: Option<Encoder<encoding::Framer>>,\n    component_type: ComponentType,\n    log_namespace: LogNamespace,\n) -> JoinHandle<()> {\n    let input_runner_metrics = Arc::clone(runner_metrics);\n\n    let now = Utc::now();\n\n    tokio::spawn(async move {\n        for mut input_event in input_events {\n            input_tx\n                .send(input_event.clone())\n                .await\n                .expect(\"input channel should not be closed\");\n\n            // Update the runner metrics for the sent event. This will later\n            // be used in the Validators, as the \"expected\" case.\n            let mut input_runner_metrics = input_runner_metrics.lock().await;\n\n            // the controlled edge (vector source) adds metadata to the event when it is received.\n            // thus we need to add it here so the expected values for the comparisons on transforms\n            // and sinks are accurate.\n            if component_type != ComponentType::Source\n                && let Event::Log(log) = input_event.get_event()\n            {\n                log_namespace.insert_standard_vector_source_metadata(log, \"vector\", now);\n            }\n\n            let (failure_case, mut event) = input_event.clone().get();\n\n            if let Some(encoder) = maybe_encoder.as_mut() {\n                let mut buffer = BytesMut::new();","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/components/validation/runner/mod.rs#L560-L596","documentation":"The input driver task sends every input test event into the topology's input channel and asserts the channel is still open. If input_tx.send() returns Err (SendError), the receiving side (the source's input pump inside the running topology) has been dropped — usually because the topology crashed or was torn down while input events were still being sent.","triggerScenarios":"Running run_validation when the component topology crashes mid-test (component panic picked up by crash_rx, or topology shutdown racing the input driver), causing the receiver end of the input mpsc channel to drop before all input_events are sent.","commonSituations":"A component under test panics or exits early on the first input event; test teardown ordering races; a source in the test topology fails to start so its input pump never exists.","solutions":["Check the component under test for panics/early exits on the input events used in the test case.","Inspect crash_rx / topology logs around the failure to see which component crashed before the input driver finished.","Verify the test topology's source starts successfully (no startup errors) so the input receiver stays alive."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if input_tx.is_closed() { panic!(\"topology input receiver dropped before all inputs were sent\"); }","typeGuard":null,"tryCatchPattern":"if let Err(e) = input_tx.send(input_event.clone()).await {\n    panic!(\"topology crashed while sending input: {e}\");\n}","preventionTips":["Check crash_rx for component panics before diagnosing send failures.","Ensure the test topology's source starts before spawning the input driver.","Keep input events that don't trigger early component exits in smoke tests."],"tags":["channel","topology","validation"],"backgroundTag":"broken-pipe","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"}