{"record":{"id":"2a1a6cb2b6c6b1d0","repo":"tracel-ai/burn","slug":"error-when-saving-the-state-err","errorCode":null,"errorMessage":"Error when saving the state: {err}","messagePattern":"Error when saving the state: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-train/src/checkpoint/async_checkpoint.rs","lineNumber":46,"sourceCode":"        for item in self.receiver.iter() {\n            match item {\n                Message::Restore(epoch, callback, interrupter) => {\n                    let record = self.checkpointer.restore(epoch);\n                    callback.send(record).unwrap_or_else(|err| {\n                        interrupter.map_or_else(\n                            || {\n                                panic!(\n                                    \"Error when sending response through callback channel: {err}\"\n                                )\n                            },\n                            |int| int.stop(Some(&err.to_string())),\n                        )\n                    });\n                }\n                Message::Save(epoch, state, interrupter) => {\n                    self.checkpointer.save(epoch, state).unwrap_or_else(|err| {\n                        interrupter.map_or_else(\n                            || panic!(\"Error when saving the state: {err}\"),\n                            |int| int.stop(Some(&err.to_string())),\n                        )\n                    });\n                }\n                Message::Delete(epoch, interrupter) => {\n                    self.checkpointer.delete(epoch).unwrap_or_else(|err| {\n                        interrupter.map_or_else(\n                            || panic!(\"Error when deleting the state: {err}\"),\n                            |int| int.stop(Some(&err.to_string())),\n                        )\n                    });\n                }\n\n                Message::End => {\n                    return;\n                }\n            };\n        }","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-train/src/checkpoint/async_checkpoint.rs#L28-L64","documentation":"Same callback-channel guard for the save path of the async checkpointer: when persisting checkpoint state completes and the completion notification cannot be delivered (receiver dropped), and no interrupter exists, the thread panics with the send error. It indicates the checkpoint consumer terminated before acknowledging the save result.","triggerScenarios":"Thrown at crates/burn-train/src/checkpoint/async_checkpoint.rs:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the checkpointing client alive until save acknowledgments are received.","Route shutdown through the interrupter so the worker stops instead of panicking on send failure.","Check the training loop for early termination that orphans the checkpoint channel."],"exampleFix":null,"handlingStrategy":"retry","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"}