Add security tests for pool writer and pool refill functionality

This commit is contained in:
David Osipov
2026-03-20 00:07:41 +04:00
parent 7416829e89
commit 754e4db8a9
5 changed files with 364 additions and 18 deletions

View File

@@ -71,17 +71,31 @@ impl MePool {
}
if let Some((addr, expiry)) = earliest_quarantine {
let remaining = expiry.saturating_duration_since(now);
if remaining.is_zero() {
return vec![addr];
}
drop(guard);
debug!(
%addr,
wait_ms = expiry.saturating_duration_since(now).as_millis(),
"All ME endpoints are quarantined for the DC group; retrying earliest one"
wait_ms = remaining.as_millis(),
"All ME endpoints quarantined; waiting for earliest to expire"
);
tokio::time::sleep(remaining).await;
return vec![addr];
}
Vec::new()
}
#[cfg(test)]
pub(super) async fn connectable_endpoints_for_test(
&self,
endpoints: &[SocketAddr],
) -> Vec<SocketAddr> {
self.connectable_endpoints(endpoints).await
}
pub(super) async fn has_refill_inflight_for_dc_key(&self, key: RefillDcKey) -> bool {
let guard = self.refill_inflight_dc.lock().await;
guard.contains(&key)