fix(logging): bound ECStore debug output (#6809)

Also replace deprecated Atomic::fetch_update calls with try_update so the
current Rust toolchain keeps lint and CI jobs warning-clean.

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-08-29 12:51:37 +08:00
committed by GitHub
parent 346388b63c
commit c0155f0dfa
32 changed files with 244 additions and 54 deletions
@@ -226,7 +226,7 @@ impl ColdFillCoordinator {
if self
.active_sessions
.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |current| {
.try_update(Ordering::Relaxed, Ordering::Relaxed, |current| {
(current < MAX_ACTIVE_SESSIONS).then_some(current + 1)
})
.is_err()
@@ -238,7 +238,7 @@ impl ColdFillCoordinator {
let session_id = match self
.next_session_id
.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |current| current.checked_add(1))
.try_update(Ordering::Relaxed, Ordering::Relaxed, |current| current.checked_add(1))
{
Ok(session_id) => session_id,
Err(_) => {
@@ -298,7 +298,7 @@ impl ColdFillCoordinator {
fn reserve_global_waiter(&self) -> bool {
let result = self
.global_waiters
.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |current| {
.try_update(Ordering::Relaxed, Ordering::Relaxed, |current| {
(current < MAX_GLOBAL_WAITERS).then_some(current + 1)
});
if let Ok(previous) = result {
+1 -1
View File
@@ -425,7 +425,7 @@ fn record_active_http_requests(delta: i64) {
} else {
let decrement = (-delta) as u64;
ACTIVE_HTTP_REQUESTS
.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |current| Some(current.saturating_sub(decrement)))
.try_update(Ordering::Relaxed, Ordering::Relaxed, |current| Some(current.saturating_sub(decrement)))
.unwrap_or_else(|current| current)
.saturating_sub(decrement)
};