Merge 'sim: return LimboError::Busy when busy, instead of looping forever' from Jussi Saurio

Although concurrency doesn't work yet (#2059), we do want to support
concurrency, and one good first step is not to make the simulator hang
forever once any connection gets a `Busy` result from the VDBE
Closes #2060

Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #2061
This commit is contained in:
Jussi Saurio
2025-07-12 10:34:21 +03:00
2 changed files with 14 additions and 4 deletions

View File

@@ -446,7 +446,9 @@ impl Interaction {
StepResult::Done => {
break;
}
StepResult::Busy => {}
StepResult::Busy => {
return Err(turso_core::LimboError::Busy);
}
}
}
@@ -579,7 +581,10 @@ impl Interaction {
StepResult::Done => {
break;
}
StepResult::Interrupt | StepResult::Busy => {}
StepResult::Busy => {
return Err(turso_core::LimboError::Busy);
}
StepResult::Interrupt => {}
}
}
@@ -646,7 +651,10 @@ impl Interaction {
StepResult::Done => {
break;
}
StepResult::Interrupt | StepResult::Busy => {}
StepResult::Busy => {
return Err(turso_core::LimboError::Busy);
}
StepResult::Interrupt => {}
}
}

View File

@@ -268,7 +268,9 @@ fn limbo_integrity_check(conn: &Arc<Connection>) -> Result<()> {
StepResult::Done => {
break;
}
StepResult::Busy => {}
StepResult::Busy => {
return Err(LimboError::Busy);
}
}
}