{"record":{"id":"9c2d6ad4370473a4","repo":"vectordotdev/vector","slug":"should-not-fail-to-build-current-thread-runtime","errorCode":null,"errorMessage":"should not fail to build current-thread runtime","messagePattern":"should not fail to build current-thread runtime","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/validation/runner/mod.rs","lineNumber":531,"sourceCode":") {\n    let topology_started = topology_task_coordinator.track_started();\n    let topology_completed = topology_task_coordinator.track_completed();\n    let mut topology_shutdown_handle = topology_task_coordinator.register_for_shutdown();\n\n    let mut config = config_builder\n        .build()\n        .expect(\"config should not have any errors\");\n\n    // It's possible we could extend the framework to allow specifying logic to\n    // handle that, but I don't see much value currently since the healthcheck is\n    // not enforced for components, and it doesn't impact the internal telemetry.\n    config.healthchecks.enabled = false;\n\n    _ = std::thread::spawn(move || {\n        let test_runtime = Builder::new_current_thread()\n            .enable_all()\n            .build()\n            .expect(\"should not fail to build current-thread runtime\");\n\n        test_runtime.block_on(async move {\n            info!(\"Building component topology...\");\n\n            let (topology, mut crash_rx) =\n                RunningTopology::start_init_validated(config, extra_context)\n                    .await\n                    .unwrap();\n\n            info!(\"Component topology built and spawned.\");\n            topology_started.mark_as_done();\n\n            select! {\n                // We got the signal to shutdown, so stop the topology gracefully.\n                _ = topology_shutdown_handle.wait() => {\n                    info!(\"Shutdown signal received, stopping topology...\");\n                    topology.stop().await;\n                    info!(\"Component topology stopped gracefully.\")","sourceCodeStart":513,"sourceCodeEnd":549,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/components/validation/runner/mod.rs#L513-L549","documentation":"The validation runner spawns a dedicated OS thread and builds a current-thread Tokio runtime inside it to drive the component topology. Building a Tokio runtime with enable_all() essentially never fails on a healthy system, so the code asserts success with expect. A failure here indicates a runtime/environment-level problem, not a problem with the component being validated.","triggerScenarios":"Builder::new_current_thread().enable_all().build() returning an error inside the spawned thread in spawn_component_topology — e.g. Tokio feature flags disabled at compile time, resource exhaustion (thread/fd limits), or an incompatible custom runtime setup in an embedded environment.","commonSituations":"Building Vector with a non-default Tokio feature set that lacks the needed drivers, running tests in a heavily constrained container hitting thread/process limits, or embedding the validation runner in another binary with altered runtime assumptions.","solutions":["Check that Tokio is compiled with full features (rt, net, time, io) in the validation crate's dependency graph.","Raise the container's thread/process/fd limits and re-run the validation test.","Inspect the returned runtime error by replacing expect with unwrap_or_else to surface the underlying io error."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"let rt = Builder::new_current_thread().enable_all().build();\nassert!(rt.is_ok(), \"tokio runtime unavailable: {:?}\", rt.err());","typeGuard":null,"tryCatchPattern":"match Builder::new_current_thread().enable_all().build() {\n    Ok(rt) => rt,\n    Err(e) => panic!(\"runtime init failed in validation thread: {e}\"),\n}","preventionTips":["Keep Tokio features (rt, net, time, io) enabled in the workspace's dependency config.","Watch container thread/fd limits when running validation suites in CI.","Surface the raw io error instead of a bare expect when debugging."],"tags":["tokio","runtime","threads"],"backgroundTag":"module-init-failed","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"}