{"record":{"id":"27f309ba2a51804c","repo":"tracel-ai/burn","slug":"killing-training-from-user-input","errorCode":null,"errorMessage":"Killing training from user input.","messagePattern":"Killing training from user input\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-train/src/renderer/tui/renderer.rs","lineNumber":135,"sourceCode":"\n        let init = Progress::new(0, 0, None);\n        Self {\n            sender,\n            interrupter,\n            handle_join: Some(handle_join),\n            kill_signal: Arc::new(Mutex::new(kill_signal_receiver)),\n            current_split: TuiSplit::Train,\n            training_progress: ProgressSnapshot::new(init.clone(), init.clone()),\n            eval_progress: ProgressSnapshot::new(init.clone(), init),\n        }\n    }\n\n    fn send_event(&self, event: TuiRendererEvent) {\n        if self.kill_signal.lock().unwrap().try_recv().is_ok()\n            || USER_KILL_REQUESTED.load(Ordering::Relaxed)\n        {\n            USER_KILL_REQUESTED.store(true, Ordering::Relaxed);\n            panic!(\"Killing training from user input.\");\n        }\n\n        if let Err(e) = self.sender.send(event) {\n            // Ignore send errors if we are already in the middle of killing\n            if !USER_KILL_REQUESTED.load(Ordering::Relaxed) {\n                log::warn!(\"Failed to send TUI event: {e}\");\n            }\n        }\n    }\n\n    /// Set the renderer to persistent mode.\n    pub fn persistent(self) -> Self {\n        self.send_event(TuiRendererEvent::Persistent);\n        self\n    }\n}\n\nstruct TuiMetricsRenderer {","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-train/src/renderer/tui/renderer.rs#L117-L153","documentation":"Deliberate shutdown panic in the TUI renderer's `send_event`: a kill was requested (via the TUI kill signal channel or the global USER_KILL_REQUESTED flag), so the renderer panics to tear down the rendering thread and stop training from user input.","triggerScenarios":"Thrown at crates/burn-train/src/renderer/tui/renderer.rs:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an intentional user-initiated termination; no fix is needed","Catch the unwind in the training harness if you need cleanup before exit","Use the interrupter/graceful-stop API instead of the kill signal when a soft stop is desired"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}