You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve race conditions, shutdown leaks, and critical bugs across pipeline
Fix data races:
- Add sync.RWMutex to dedup hash table in capture, protecting concurrent
read/write during packet processing and ticker cleanup
- Add domainFilterMu sync.RWMutex to domain skip/allow filtering, ensuring
thread-safe hot-reload of domain lists
- Add splunkConnMu sync.RWMutex to protect global splunk connection map
- Convert all captureConfig methods from value to pointer receivers to
prevent copying the embedded mutex
Fix critical bugs:
- packet.go: use packet.ip instead of stale local ip4 in defrag return
path, which caused incorrect protocol detection and flow extraction
- util.go: MaskSize6 validation checked MaskSize4 for lower bound
- influx.go: metric counter used wrong name "stdoutSkipped"
- util.go: remove redundant nested if-err-not-nil in config parsing
Fix graceful shutdown:
- Add defer close(closeChannel) to all 12 output backends to prevent
Close() from deadlocking on context cancellation
- Add case <-ctx.Done() to output worker loops (sentinel, splunk, zinc,
victorialogs) that were missing it
- Add sync.WaitGroup for worker lifecycle tracking in influx, parquet,
postgres, stdout, victorialogs outputs
Replace log.Fatal with recoverable errors:
- elastic, file, postgres, syslog, influx, functions.go: return errors
instead of fataling, allowing the dispatch loop to gracefully remove
failed outputs
- LoadDomainsCsv now returns error as 4th value; callers log and skip
update on failure instead of crashing
Other fixes:
- outputs.go: non-blocking fan-out dispatch with dropped packet metrics
- packet.go: log and count silent decode errors via decodingErrors metric
- packet.go: single errgroup for all input handler workers
- livecap_windows.go: snaplen 1600 -> 65535
- parquet.go: iterate all DNS questions instead of only first
- functions.go: store suffix domains pre-reversed for efficient lookup,
add 30s HTTP timeout for remote domain lists
- splunk.go: remove deprecated rand.Seed
- main.go: remove no-op ctx.Done(), bound spin-wait with ctx.Err()
Add tests for dedup concurrency, defrag path correctness, transport
processing (UDP/TCP/non-DNS), and decode error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments