Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix(concurrency): stop the transaction committer when the scheduler i…
Browse files Browse the repository at this point in the history
…s done (#1989)
  • Loading branch information
avi-starkware committed Jun 17, 2024
1 parent 4a674cc commit c7e4ee3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/blockifier/src/concurrency/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ impl<'a> TransactionCommitter<'a> {
/// Tries to commit the next uncommitted transaction in the chunk. Returns the index of the
/// transaction to commit if successful, or None if the transaction is not yet executed.
pub fn try_commit(&mut self) -> Option<usize> {
if *self.commit_index_guard >= self.scheduler.chunk_size {
if self.scheduler.done() {
return None;
};
assert!(
*self.commit_index_guard < self.scheduler.chunk_size,
"The commit index must be less than the chunk size, since the scheduler is not done."
);

let mut status = self.scheduler.lock_tx_status(*self.commit_index_guard);
if *status != TransactionStatus::Executed {
Expand Down

0 comments on commit c7e4ee3

Please sign in to comment.