Add IdleTimeout to default docker.m Aerospike utxostore#1049
Conversation
|
🤖 Claude Code Review Status: Complete Current Review: Minor documentation gap: Change verified:
|
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-06-08 09:16 UTC |
|
ordishs
left a comment
There was a problem hiding this comment.
Approve. Verified the change is wired correctly:
IdleTimeoutis parsed (util/aerospike.go:333) and mapped ontopolicy.IdleTimeout— not silently ignored.getQueryDurationusestime.ParseDuration, so60sparses to 60 seconds. Note an integer (60) would be rejected here, so the duration syntax is the right form.- The param sits in the top-level Aerospike URL query, not inside the percent-encoded
externalStoresub-URL — no nesting hazard, and query-param order is irrelevant.
One durable risk worth flagging: correctness depends on the server's proto-fd-idle-ms staying > 60s (deployment runs 120s). That invariant lives only in the PR description — it isn't enforced anywhere in this repo. If a future deployment lowers the server value below 60s, clients could grab server-reaped sockets and throw.
Optional (non-blocking): consider an inline comment in settings.conf capturing the dependency, e.g.
# IdleTimeout must stay below server proto-fd-idle-ms (deployment: 120s)
Otherwise solid and ready to merge.



What
Add
IdleTimeout=60sto theutxostore.docker.mAerospike connection URL default.Why
The Aerospike Go client's
ClientPolicy.IdleTimeoutdefaults to0— a live client never reaps its own idle sockets. Thedocker.mUTXO store URL never set it, so idle connections are never cleaned up on the client side.Combined with a server that isn't reaping either (
proto-fd-idle-msis off by default and deprecated in the 8.x line), connections only ever accumulate towardproto-fd-maxand never come back down. On a downed cluster — all Teranode containers stopped, zero live clients — the Aerospike server was observed holding ~21k orphan client connections (client_connections_opened − client_connections_closed) against aproto-fd-maxof 30k. Booting Teranode on top of that pool walks straight into the ceiling and connections start failing.IdleTimeout=60smakes a live client reap its own excess idle connections after 60s.Behavior notes
MinConnectionsPerNode=16reserve is exempt from idle reaping — verified in the client pool (connection_heap.go DropIdleonly drops connections above the min floor; reserve conns get their idle deadline refreshed each tend). The reserve stays warm; only connections above 16 are reaped.IdleTimeoutmust stay below the server'sproto-fd-idle-msso the client reaps its own socket before the server does — grabbing a socket the server already reaped throws. Pair this with a server-sideproto-fd-idle-mshigher than 60s (our deployment runs120000/ 2 min).Scope
docker.mprofile only. The other Aerospike UTXO URLs (dev.legacy,teratestnet) also omitIdleTimeoutbut run single-node localhost dev setups where orphan accumulation hasn't bitten; left unchanged.