tracel-ai/burn · error
Error when sending response through callback channel: {err}
Error message
Error when sending response through callback channel: {err} What it means
Channel-failure escalation in the async checkpointer thread: after restoring a checkpoint, the worker sends the record back via a oneshot callback; if the receiver was dropped (training loop shut down or interrupted) the send fails and this panic fires — but only when no interrupter is available to stop the loop gracefully. It signals that the caller vanished before reading the restored checkpoint, not a checkpoint corruption.
Source
Thrown at crates/burn-train/src/checkpoint/async_checkpoint.rs:35
struct CheckpointerThread<C, R> {
checkpointer: C,
receiver: mpsc::Receiver<Message<R>>,
}
impl<C, R> CheckpointerThread<C, R>
where
C: Checkpointer<R>,
R: Checkpoint,
{
fn run(self) {
for item in self.receiver.iter() {
match item {
Message::Restore(epoch, callback, interrupter) => {
let record = self.checkpointer.restore(epoch);
callback.send(record).unwrap_or_else(|err| {
interrupter.map_or_else(
|| {
panic!(
"Error when sending response through callback channel: {err}"
)
},
|int| int.stop(Some(&err.to_string())),
)
});
}
Message::Save(epoch, state, interrupter) => {
self.checkpointer.save(epoch, state).unwrap_or_else(|err| {
interrupter.map_or_else(
|| panic!("Error when saving the state: {err}"),
|int| int.stop(Some(&err.to_string())),
)
});
}
Message::Delete(epoch, interrupter) => {
self.checkpointer.delete(epoch).unwrap_or_else(|err| {
interrupter.map_or_else(View on GitHub (pinned to d16f7ba2ed)
Solutions
- Ensure the training loop keeps the callback receiver alive until the restore result is consumed.
- Check for early exits/panics in the caller thread that drop the channel before receiving.
- Provide the interrupter so shutdown paths stop the loop instead of panicking on a dead channel.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/burn-train/src/checkpoint/async_checkpoint.rs:35 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tracel-ai/burn@d16f7ba2ed (2026-09-05).
Data as JSON: /api/errors/52b46cd8df80e8c3.
Report an issue: GitHub.