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

fix(concurrency): stop the transaction committer when the scheduler is done #1989

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading