Release v0.3.119
Summary
- Timeout: Increase default HTTP client timeout from 5s to 30s. Both node-agent and synchronizer had the same 5s limit, causing a race where the synchronizer's
ReadTimeoutcould close the connection before responding, producing spuriouscontext deadline exceeded (Client.Timeout exceeded while awaiting headers)errors — no high CPU required to trigger this. - Mutex stall:
eventsStorageMutexwas held for the entire HTTP round-trip (up to 5s on timeout), blocking allReportEvent/handleNetworkEvent/handleDnsEventgoroutines. Fixed by snapshotting under the lock and releasing before the HTTP call. A newEntitiesmap with entity structs copied by value is sufficient — the clearing loop never mutatesInbound/Outboundmaps in place, so the old maps become exclusively owned by the snapshot once the lock is released. - Empty-stream skip:
sendNetworkEventlogged "skipping" for empty streams but still sent the HTTP request. Added the missingreturn nil.
Deploy note: the timeout fix requires the matching change in
kubescape/synchronizer(raiseReadTimeoutto 30s) to be deployed together.
Test plan
- Verify no
context deadline exceedederrors in node-agent logs after deploying both PRs together - Confirm empty network stream intervals no longer generate HTTP requests to the synchronizer
- Confirm network/DNS event recording is not stalled during a synchronizer outage
🤖 Generated with Claude Code
Summary by CodeRabbit
-
Bug Fixes
- HTTP request timeout increased from 5 to 30 seconds for improved stability.
-
Performance
- Network event processing now skips unnecessary operations when no events are present.
- Improved concurrency handling in network event storage and transmission.