Skip to content

Commit e9d0c1e

Browse files
sanityclaude
andcommitted
Reduce proximity cache startup grace period from 30s to 5s
The 30-second startup grace period was causing test flakiness in `test_multiple_clients_subscription`. The test would fail because: 1. Node A caches a contract during startup but delays the proximity cache announcement for 30 seconds 2. Node B tries to GET the contract before the announcement is sent 3. Without the proximity cache information, Node B can't locate the contract and times out Reducing the grace period to 5 seconds: - Still provides batching benefits during rapid contract loading - Prevents long delays in cross-node GET operations - Fixes the flaky test that was timing out after 8+ minutes in CI The 5-second window is sufficient for batching announcements during the rapid initialization phase while not causing excessive delays for critical operations. Fixes test_multiple_clients_subscription timeout issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 4868c33 commit e9d0c1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/core/src/node/proximity_cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl ProximityCacheManager {
9292
&self,
9393
contract_key: &ContractKey,
9494
) -> Option<ProximityCacheMessage> {
95-
const STARTUP_GRACE_PERIOD: Duration = Duration::from_secs(30);
95+
const STARTUP_GRACE_PERIOD: Duration = Duration::from_secs(5);
9696

9797
let contract_id = *contract_key.id();
9898

@@ -202,7 +202,7 @@ impl ProximityCacheManager {
202202
use crate::config::GlobalExecutor;
203203

204204
GlobalExecutor::spawn(async move {
205-
const STARTUP_GRACE_PERIOD: Duration = Duration::from_secs(30);
205+
const STARTUP_GRACE_PERIOD: Duration = Duration::from_secs(5);
206206

207207
// Wait for startup grace period to complete
208208
tokio::time::sleep(STARTUP_GRACE_PERIOD).await;

0 commit comments

Comments
 (0)