Skip to content

Commit 78d797a

Browse files
ma2bdclaude
authored andcommitted
Poison and evict chain worker on any save failure (linera-io#6053)
## Motivation Fixes linera-io#6052. Previously only journal resolution failures poisoned the chain worker. Other write errors (e.g. possible ScyllaDB timeouts) left the worker loaded with potentially stale state. Stacked on linera-io#6051. ## Proposal - **Poison on any save failure**: `ChainWorkerState::save()` now always sets `poisoned = true` and returns `WorkerError::PoisonedWorker` on any error, triggering immediate eviction and a fresh reload on the next request. - **Keep `must_reload_view`** for metrics and as way to document that journaling really requires a notion of view poisoning. ## Test Plan CI ## Links - Fixes linera-io#6052 - Stacked on linera-io#6051 - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c4ee110 commit 78d797a

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

linera-core/src/chain_worker/state.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,15 +2109,13 @@ where
21092109
))]
21102110
async fn save(&mut self) -> Result<(), WorkerError> {
21112111
if let Err(error) = self.chain.save().await {
2112-
if error.must_reload_view() {
2113-
tracing::error!(
2114-
?error,
2115-
chain_id = %self.chain_id(),
2116-
"Journal resolution failed; marking worker as poisoned"
2117-
);
2118-
self.poisoned = true;
2119-
}
2120-
return Err(error.into());
2112+
tracing::error!(
2113+
?error,
2114+
chain_id = %self.chain_id(),
2115+
"Chain save failed; marking worker as poisoned"
2116+
);
2117+
self.poisoned = true;
2118+
return Err(WorkerError::PoisonedWorker);
21212119
}
21222120
Ok(())
21232121
}

0 commit comments

Comments
 (0)