[8.19](backport #51737) x-pack/filebeat/input/streaming: self-heal CrowdStrike transient discover failures#51763
Conversation
…over failures (#51737) Transient connection-level failures from the CrowdStrike discover endpoint previously counted toward the retry attempt limit and, once it was exceeded, terminated the input and required an agent restart to recover. An empty 200 body (io.EOF), a network error, or a timeout while reaching discover or fetching the OAuth token are now classified as a transientError and retried with capped back-off indefinitely, so the input self-heals once the upstream recovers. Termination is reserved for genuine hardErrors (origin mismatch, publish failure). Other soft errors -- non-200 discover responses, OAuth auth failures from bad credentials, malformed discover bodies, and firehose failures -- still honour the configured (or default) attempt cap, so a real misconfiguration continues to surface rather than retrying forever. A net.Error check distinguishes network failures from HTTP-level ones so an auth error is not mistaken for a transient failure. The retry loop keeps two counters: attempt, which only counts non-transient failures and drives the termination cap, and failures, which counts every consecutive failure and drives the back-off and DEGRADED reporting. This keeps transient failures from eroding the attempt budget of a later non-transient failure, while a persistent transient outage still backs off and is surfaced as DEGRADED without terminating the input. TestCrowdstrikeOAuthHTTPClientRespectsConfiguredTimeout is updated for the new behaviour: a token-fetch timeout now retries rather than terminating, so the test verifies the configured timeout is still respected on each attempt (the discover endpoint is never reached) instead of expecting the input to fail. Add tests for the transient retry-past-cap path, the transient discover GET failure, and that transient failures do not consume the non-transient attempt cap. Assisted-By: Cursor (Claude Opus 4.8) (cherry picked from commit ff9660b) # Conflicts: # x-pack/filebeat/input/streaming/crowdstrike.go
|
Cherry-pick of ff9660b has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
🤖 GitHub commentsJust comment with:
|
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
TL;DR
Remediation
Investigation detailsRoot CauseThis is a configuration/code hygiene failure from an incomplete conflict resolution in the automatic backport. The Buildkite checkout merged PR The PR head currently contains this unresolved hunk: // x-pack/filebeat/input/streaming/crowdstrike.go:297-303
var waitTime time.Duration
if s.cfg.Retry != nil {
<<<<<<< HEAD
waitTime = calculateWaitTime(s.cfg.Retry.WaitMin, s.cfg.Retry.WaitMax, attempt)
=======
waitTime = calculateWaitTime(s.cfg.Retry.WaitMin, s.cfg.Retry.WaitMax, failures, s.cfg.Retry.MaxAttempts)
>>>>>>> ff9660ba6 (x-pack/filebeat/input/streaming: self-heal CrowdStrike transient discover failures (#51737))The Evidence
VerificationNot run locally; the failure is from a static pre-commit hook detecting literal conflict markers in the PR content. What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
TL;DR
Remediation
Investigation detailsRoot CauseThe PR head still contains test setup that is forbidden by the repo lint rules. The current GitHub Actions failure is materially different from the earlier Buildkite detective report about unresolved conflict markers: this run reaches Evidence
Affected PR source locations: // x-pack/filebeat/input/streaming/crowdstrike_test.go:45-47
func TestCrowdstrikeFalconHose(t *testing.T) {
logp.TestingSetup()
logger := logp.L()// x-pack/filebeat/input/streaming/crowdstrike_unit_test.go:26-28
func TestFollowSession_FirehoseHTTPError(t *testing.T) {
logp.TestingSetup()// x-pack/filebeat/input/streaming/crowdstrike_unit_test.go:120-122
func TestFollowSession_NonObjectMessage(t *testing.T) {
logp.TestingSetup()ValidationNot run locally; this read-only workflow inspected the failed Actions logs and PR source only. Follow-upAfter the logger cleanup, rerun the What is this? | From workflow: PR Actions Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
Proposed commit message
Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
How to test this PR locally
Related issues
Use cases
Screenshots
Logs
This is an automatic backport of pull request #51737 done by [Mergify](https://mergify.com).