Skip to content

[8.17](backport #46331) Fix Filebeat's race condition on shutdown#46393

Closed
mergify[bot] wants to merge 1 commit into8.17from
mergify/bp/8.17/pr-46331
Closed

[8.17](backport #46331) Fix Filebeat's race condition on shutdown#46393
mergify[bot] wants to merge 1 commit into8.17from
mergify/bp/8.17/pr-46331

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Sep 4, 2025

Note for reviewers

The detailed description of the issue this PR solves can be found at #45034 (comment)

Proposed commit message

When Filebeat fails to start because of a unknown input, it can get into a deadlock state and never exit. This commit attempts to fix it.

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
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

## Disruptive User Impact
## Author's Checklist

How to test this PR locally

That's a non-deterministic problem, so testing is about running Filebeat over and over again and ensuring it never hangs during shutdown.

You can file the reproducing steps listed in the linked issue below, to run Filebeat over and over again, use the following script:

#!/bin/bash

# while "$@"; do :; done
counter=0
while true; do
    "$@"
    let counter++
    echo $counter
    true
done

Assuming the script is named rununtilfail and is ~/bin/rununtilfail , you can run:

~/bin/rununtilfail ./filebeat -c ./filebeat-test.yml -e

Let it run for a few minutes, if Filebeat never hangs, then it's very likely the issue has been solved.

On my tests, it usually took less than 100 runs for Filebeat to hang, in more extreme cases it would take a couple thousand tries for Filebeat to hang.

Related issues

## Use cases
## Screenshots
## Logs


This is an automatic backport of pull request #46331 done by Mergify.

When Filebeat fails to start because of a unknown input, it can get
into a deadlock state and never exit. This commit attempts to fix it.

(cherry picked from commit 3ee3201)
@mergify mergify bot added the backport label Sep 4, 2025
@mergify mergify bot requested a review from a team as a code owner September 4, 2025 21:42
@mergify mergify bot removed the request for review from a team September 4, 2025 21:42
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 4, 2025
@botelastic
Copy link
Copy Markdown

botelastic bot commented Sep 4, 2025

This pull request doesn't have a Team:<team> label.

@mergify mergify bot mentioned this pull request Sep 4, 2025
6 tasks
@mergify mergify bot deleted the mergify/bp/8.17/pr-46331 branch September 5, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants