postoverflow: run them in a goroutine to not block writers, enforce max in-flight alerts, and warn if queue is becoming too full - #4672
postoverflow: run them in a goroutine to not block writers, enforce max in-flight alerts, and warn if queue is becoming too full#4672blotus wants to merge 6 commits into
Conversation
…ax in-flight alerts, and warn if queue is becoming too full
|
@blotus: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
@blotus: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
/kind fix |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4672 +/- ##
==========================================
+ Coverage 64.71% 64.73% +0.01%
==========================================
Files 522 522
Lines 39862 39958 +96
==========================================
+ Hits 25798 25868 +70
- Misses 11663 11683 +20
- Partials 2401 2407 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Postoverflow parsing ran inline in the
runOutputselect loop. Postoverflow nodes doblocking I/O (such as
crowdsecurity/rdnsthat does a PTR lookup) and thepipeline channels are unbuffered, so one slow lookup backpressured everything upstream:
buckets, parsers, acquisition, and the appsec runner, which emits into that same chain
before writing the in-band response. WAF requests then exceeded the remediation
component's
APPSEC_PROCESS_TIMEOUTand failed open.Postoverflow now runs in a worker behind a bounded queue, so the pipeline never waits on
it.
On a full queue the overflow is dropped and counted, rather than blocking: postoverflow
is where the whitelists run, so pushing an alert unparsed would turn a stall into false
positive bans. Dump mode (
cscli explain,-dsn) still parses inline.New config, with the flat
*_routineskeys kept as the fallback:New metrics cs_postoverflow_queue_depth and cs_postoverflow_dropped_total, plus a
warning at 75% full so the queue is visible before anything is lost.
Fixes #4600