{"record":{"id":"0ff328e45a0b1f14","repo":"firecracker-microvm/firecracker","slug":"one-shot-channel-closed","errorCode":null,"errorMessage":"one-shot channel closed","messagePattern":"one-shot channel closed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/firecracker/src/api_server_adapter.rs","lineNumber":93,"sourceCode":"                .expect(\"Poisoned lock\")\n                .handle_request(event_manager);\n\n            match vmm.lock().unwrap().shutdown_exit_code() {\n                Some(FcExitCode::Ok) => break,\n                Some(exit_code) => return Err(ApiServerError::MicroVMStoppedWithError(exit_code)),\n                None => continue,\n            }\n        }\n        Ok(())\n    }\n\n    fn _handle_request(&mut self, req_action: VmmAction, event_manager: &mut EventManager) {\n        let response = self.controller.handle_request(req_action, event_manager);\n        // Send back the result.\n        self.to_api\n            .send(Box::new(response))\n            .map_err(|_| ())\n            .expect(\"one-shot channel closed\");\n    }\n\n    fn handle_request(&mut self, event_manager: &mut EventManager) {\n        if let Some(api_request) = self.request.take() {\n            let request_is_pause = *api_request == VmmAction::Pause;\n            self._handle_request(*api_request, event_manager);\n\n            // If the latest req is a pause request, temporarily switch to a mode where we\n            // do blocking `recv`s on the `from_api` receiver in a loop, until we get\n            // unpaused. The device emulation is implicitly paused since we do not\n            // return to `run_microvm` and hence `event_manager.run()` is not called\n            // again: device fds (virtqueue notifications, tap, rate limiters, timers)\n            // are not polled until we break out of this loop on `Resume`.\n            if request_is_pause {\n                // This loop only attempts to process API requests, so things like the\n                // metric flush timerfd handling are frozen as well (an explicit `FlushMetrics`\n                // request still goes through).\n                loop {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/firecracker-microvm/firecracker/blob/23b09b943fa3cd4a04004fe55724f0b5c2410f45/src/firecracker/src/api_server_adapter.rs#L75-L111","documentation":"Error \"one-shot channel closed\" thrown in firecracker-microvm/firecracker.","triggerScenarios":"Thrown at src/firecracker/src/api_server_adapter.rs:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the sender side of the one-shot channel is kept alive until the response is sent.","Handle the closed channel as a shutdown signal and abort the pending operation cleanly."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"23b09b943fa3cd4a04004fe55724f0b5c2410f45","analyzedAt":"2026-08-19T05:27:02.517Z","contentChangedAt":"2026-08-19T05:27:02.517Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}