dgram.Listener return error on connection failure#46302
Merged
belimawr merged 10 commits intoelastic:mainfrom Sep 10, 2025
Merged
dgram.Listener return error on connection failure#46302belimawr merged 10 commits intoelastic:mainfrom
belimawr merged 10 commits intoelastic:mainfrom
Conversation
The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run.
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Contributor
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
Contributor
|
This pull request is now in conflicts. Could you fix it? 🙏 |
mauri870
approved these changes
Sep 1, 2025
Contributor
Author
|
The tests have been failing because of our seccomp policy, more details on #46333. Once the fix is merged I'll update this PR. |
Contributor
|
This pull request is now in conflicts. Could you fix it? 🙏 |
TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests.
Contributor
|
@Mergifyio backport 8.18 8.19 9.0 9.1 |
Contributor
✅ Backports have been createdDetails
|
mergify bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run. * Add changelog * Fix log level * mage check * double test timeout * Try using 127.0.0.1 instead of all interfaces * TestLogStatusReporter run Filebeat as a sub process TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests. (cherry picked from commit 46ae121) # Conflicts: # filebeat/input/unix/input.go # x-pack/filebeat/tests/integration/status_reporter_test.go
mergify bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run. * Add changelog * Fix log level * mage check * double test timeout * Try using 127.0.0.1 instead of all interfaces * TestLogStatusReporter run Filebeat as a sub process TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests. (cherry picked from commit 46ae121) # Conflicts: # filebeat/input/unix/input.go # x-pack/filebeat/tests/integration/status_reporter_test.go
mergify bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run. * Add changelog * Fix log level * mage check * double test timeout * Try using 127.0.0.1 instead of all interfaces * TestLogStatusReporter run Filebeat as a sub process TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests. (cherry picked from commit 46ae121)
mergify bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run. * Add changelog * Fix log level * mage check * double test timeout * Try using 127.0.0.1 instead of all interfaces * TestLogStatusReporter run Filebeat as a sub process TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests. (cherry picked from commit 46ae121) # Conflicts: # filebeat/input/unix/input.go # x-pack/filebeat/tests/integration/status_reporter_test.go
6 tasks
belimawr
added a commit
that referenced
this pull request
Sep 10, 2025
The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run. TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests. (cherry picked from commit 46ae121) Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
shmsr
pushed a commit
that referenced
this pull request
Sep 11, 2025
The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run. * Add changelog * Fix log level * mage check * double test timeout * Try using 127.0.0.1 instead of all interfaces * TestLogStatusReporter run Filebeat as a sub process TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests.
belimawr
added a commit
that referenced
this pull request
Sep 19, 2025
…lure (#46508) The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run. TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests. (cherry picked from commit 46ae121) # Conflicts: # filebeat/input/unix/input.go # x-pack/filebeat/tests/integration/status_reporter_test.go * Fix merge conflicts * Fix changelog * The UDP input does not report status on 8.18, so remove the test * Fix merge conflicts --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
belimawr
added a commit
that referenced
this pull request
Sep 19, 2025
…ure (#46510) The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run. TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests. (cherry picked from commit 46ae121) # Conflicts: # filebeat/input/unix/input.go # x-pack/filebeat/tests/integration/status_reporter_test.go --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
belimawr
added a commit
that referenced
this pull request
Sep 22, 2025
…ure (#46511) The Listener.doRun method previously logged connection failures at a debug level but did not return an error to the caller. This made it difficult for users to understand why a input was not working. This commit modifies Listener.doRun to return an error when a connection failure occurs and also updates the UDP and Unix inputs to set their status as failed when an error is returned by Listener.Run. TestLogStatusReporter was starting the Filebeat command (github.com/elastic/beats/v7/x-pack/filebeat/cmd.Filebeat()) as part of the test, this loaded the default seccomp policy, blocking system calls needed by subsequent tests like 'pidfd_send_signal'. This commit fixes the problem by running Filebeat as a sub process, like all the other integration tests, thus providing the necessary isolation between tests. (cherry picked from commit 46ae121) # Conflicts: # filebeat/input/unix/input.go # x-pack/filebeat/tests/integration/status_reporter_test.go --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.## Disruptive User Impact## Author's ChecklistHow to test this PR locally
Start netcat to listen on a UDP port
Start sending data to this port using flog
You will start to see some data on your terminal
On another terminal start Filebeat with the following configuration
filebeat.yaml
You should see two log error:
Related issues
## Use cases## Screenshots## Logs