Skip to content

Commit

Permalink
chore(db): add log for read transaciton monitor sleep time (#12408)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored Nov 8, 2024
1 parent f03b762 commit ba4f169
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/storage/libmdbx-rs/src/txn_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,11 @@ mod read_transactions {

// Sleep not more than `READ_TRANSACTIONS_CHECK_INTERVAL`, but at least until
// the closest deadline of an active read transaction
let duration_until_closest_deadline =
self.max_duration - max_active_transaction_duration.unwrap_or_default();
std::thread::sleep(
READ_TRANSACTIONS_CHECK_INTERVAL.min(duration_until_closest_deadline),
let sleep_duration = READ_TRANSACTIONS_CHECK_INTERVAL.min(
self.max_duration - max_active_transaction_duration.unwrap_or_default(),
);
trace!(target: "libmdbx", ?sleep_duration, elapsed = ?now.elapsed(), "Putting transaction monitor to sleep");
std::thread::sleep(sleep_duration);
}
};
std::thread::Builder::new()
Expand Down

0 comments on commit ba4f169

Please sign in to comment.