Skip to content

Set shutdown timeout for beat receivers to 5s by default#51940

Merged
mergify[bot] merged 1 commit into
elastic:mainfrom
swiatekm:test/fbreceiver-1s-drain-timeout
Jul 14, 2026
Merged

Set shutdown timeout for beat receivers to 5s by default#51940
mergify[bot] merged 1 commit into
elastic:mainfrom
swiatekm:test/fbreceiver-1s-drain-timeout

Conversation

@swiatekm

Copy link
Copy Markdown
Member

Proposed commit message

Set shutdown timeout for beat receivers to 5s by default.

Beat receivers need a longer timeout than the default 1s, as it needs to exceed the batcher flush timeout. The current code gives the impression of this already happening, but in reality, if the beater handles pipeline shutdown on its own, the default timeout wins.

The PR adds the default in NewBeatForReceiver and adds a test for filebeat receiver which asserts that the timeout is at least 5 seconds.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool.

Related issues

Beat receivers need a longer timeout than the default 1s, as it needs to
exceed the batcher flush timeout. The current code gives the impression
of this already happening, but in reality, if the beater handles
pipeline shutdown on its own, the default timeout wins.
@swiatekm swiatekm added bug Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team backport-active-all Automated backport with mergify to all the active branches skip-changelog labels Jul 14, 2026
@botelastic botelastic Bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@swiatekm swiatekm marked this pull request as ready for review July 14, 2026 17:15
@swiatekm swiatekm requested a review from a team as a code owner July 14, 2026 17:15
@swiatekm swiatekm requested review from AndersonQ and belimawr July 14, 2026 17:15
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@mergify

mergify Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 28 minutes 27 seconds in the queue, including 1 hour 27 minutes 30 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Jul 14, 2026
mergify Bot added a commit that referenced this pull request Jul 14, 2026
@mergify mergify Bot merged commit 8f4bbab into elastic:main Jul 14, 2026
139 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@Mergifyio backport 9.5 9.4 9.3 8.19

@mergify mergify Bot removed the queued label Jul 14, 2026
@mergify

mergify Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

backport 9.5 9.4 9.3 8.19

✅ Backports have been created

Details

Cherry-pick of 8f4bbab has failed:

On branch mergify/bp/8.19/pr-51940
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit 8f4bbab77.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   x-pack/libbeat/cmd/instance/beat.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   x-pack/filebeat/fbreceiver/receiver_test.go

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches bug skip-changelog Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants