Remove InsnFunctionStepResult::Busy

we don't need all these busy variants, let's just handle
LimboError::Busy
This commit is contained in:
Jussi Saurio
2025-09-17 11:22:49 +03:00
parent dc103da2ed
commit b9ceacc356
3 changed files with 3 additions and 13 deletions

View File

@@ -435,11 +435,6 @@ impl CompiledExpression {
"Expression evaluation was interrupted".to_string(), "Expression evaluation was interrupted".to_string(),
)); ));
} }
crate::vdbe::execute::InsnFunctionStepResult::Busy => {
return Err(crate::LimboError::InternalError(
"Expression evaluation encountered busy state".to_string(),
));
}
crate::vdbe::execute::InsnFunctionStepResult::Step => { crate::vdbe::execute::InsnFunctionStepResult::Step => {
pc = state.pc as usize; pc = state.pc as usize;
} }

View File

@@ -159,7 +159,6 @@ pub enum InsnFunctionStepResult {
IO(IOCompletions), IO(IOCompletions),
Row, Row,
Interrupt, Interrupt,
Busy,
Step, Step,
} }
@@ -2205,11 +2204,7 @@ pub fn op_transaction(
!conn.is_nested_stmt.get(), !conn.is_nested_stmt.get(),
"nested stmt should not begin a new read transaction" "nested stmt should not begin a new read transaction"
); );
let res = pager.begin_read_tx(); let res = pager.begin_read_tx()?;
if let Err(LimboError::Busy) = res {
return Ok(InsnFunctionStepResult::Busy);
}
res?;
} }
if updated && matches!(new_transaction_state, TransactionState::Write { .. }) { if updated && matches!(new_transaction_state, TransactionState::Write { .. }) {
@@ -2227,7 +2222,7 @@ pub fn op_transaction(
conn.transaction_state.replace(TransactionState::None); conn.transaction_state.replace(TransactionState::None);
} }
assert_eq!(conn.transaction_state.get(), current_state); assert_eq!(conn.transaction_state.get(), current_state);
return Ok(InsnFunctionStepResult::Busy); return Err(LimboError::Busy);
} }
if let IOResult::IO(io) = begin_w_tx_res? { if let IOResult::IO(io) = begin_w_tx_res? {
// set the transaction state to pending so we don't have to // set the transaction state to pending so we don't have to

View File

@@ -675,7 +675,7 @@ impl Program {
// Instruction interrupted - may resume at same PC // Instruction interrupted - may resume at same PC
return Ok(StepResult::Interrupt); return Ok(StepResult::Interrupt);
} }
Ok(InsnFunctionStepResult::Busy) => { Err(LimboError::Busy) => {
// Instruction blocked - will retry at same PC // Instruction blocked - will retry at same PC
return Ok(StepResult::Busy); return Ok(StepResult::Busy);
} }