{"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            // relinquish control to the event manager because we're not returning from\n            // `process`.\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.\n                loop {\n                    let req = self.from_api.recv().expect(\"Error receiving API request.\");\n                    let req_is_resume = *req == VmmAction::Resume;","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/firecracker-microvm/firecracker/blob/0a745def42ddf4cc2a744d79a08a27ff50b5d27a/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":"0a745def42ddf4cc2a744d79a08a27ff50b5d27a","analyzedAt":"2026-08-19T05:27:02.517Z","contentChangedAt":"2026-08-19T05:27:02.517Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}