mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-02 02:08:41 +00:00
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:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user