when run_once fails we abort the current IOCompletions

This commit is contained in:
pedrocarlo
2025-08-20 01:26:19 -03:00
parent f27d4d14f2
commit d61d6c0872
2 changed files with 11 additions and 0 deletions

View File

@@ -2048,6 +2048,9 @@ impl Statement {
return res;
}
if res.is_err() {
if let Some(io) = &self.state.io_completions {
io.abort();
}
let state = self.program.connection.transaction_state.get();
if let TransactionState::Write { .. } = state {
let end_tx_res = self.pager.end_tx(true, &self.program.connection, true)?;

View File

@@ -2494,6 +2494,14 @@ impl IOCompletions {
IOCompletions::Many(completions) => completions.iter().all(|c| c.finished()),
}
}
/// Send abort signal to completions
pub fn abort(&self) {
match self {
IOCompletions::Single(c) => c.abort(),
IOCompletions::Many(completions) => completions.iter().for_each(|c| c.abort()),
}
}
}
#[derive(Debug)]