Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(db): add log for read transaciton monitor sleep time #12408

Merged
merged 1 commit into from
Nov 8, 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
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
Loading