Skip to content

Commit 89cb4d2

Browse files
committed
core: Flush the store on fatal errors
We have runner tests failing frequently because the store seems to get dropped while it still has pending writes. This change attempts to prevent that by flushing the store when we encounter a fatal error.
1 parent df1cb62 commit 89cb4d2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/subgraph/runner.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ where
498498
// In this scenario the only entity that is stored/transacted is the PoI,
499499
// all of the others are discarded.
500500
if has_errors && self.inputs.errors_are_fatal() {
501+
if let Err(e) = self.inputs.store.flush().await {
502+
error!(logger, "Failed to flush store after fatal errors"; "error" => format!("{:#}", e));
503+
}
501504
// Only the first error is reported.
502505
return Err(ProcessingError::Deterministic(Box::new(
503506
first_error.unwrap(),

0 commit comments

Comments
 (0)