Fix error handling from BeatV2Manager reload#45733
Conversation
BeatV2Manager `reload` method calls `reloadInputs`, however it did not handle the errors returned correctly. This commit fixes it by making `reloadInputs`, whenever possible, use a cfgfile.UnitError to indicate the failed unit and handling any unexpected error case/type.
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes error handling in the BeatV2Manager's reload functionality by improving how errors from the reloadInputs method are processed and reported. The fix ensures that unit-specific errors are properly wrapped using cfgfile.UnitError and that unexpected error types are handled gracefully.
- Enhanced error handling in the
reloadmethod to properly categorize and handle different error types - Modified
reloadInputsto returncfgfile.UnitErrorfor unit-specific failures instead of generic errors - Added comprehensive test coverage for error handling scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| x-pack/libbeat/management/managerV2.go | Core error handling improvements with proper error categorization and unit-specific error wrapping |
| x-pack/filebeat/tests/integration/managerV2_test.go | New integration test for reload error handling scenarios and type updates |
| x-pack/libbeat/management/simple_input_config_test.go | Type updates from interface{} to any and minor formatting changes |
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
@Mergifyio backport 8.17 8.18 8.19 9.0 9.1 |
✅ Backports have been createdDetails
|
BeatV2Manager `reload` method calls `reloadInputs`, however it did not handle the errors returned correctly. This commit fixes it by making `reloadInputs`, whenever possible, use a cfgfile.UnitError to indicate the failed unit and handling any unexpected error case/type. (cherry picked from commit d8b1f1a) # Conflicts: # x-pack/filebeat/tests/integration/managerV2_test.go # x-pack/libbeat/management/managerV2.go
BeatV2Manager `reload` method calls `reloadInputs`, however it did not handle the errors returned correctly. This commit fixes it by making `reloadInputs`, whenever possible, use a cfgfile.UnitError to indicate the failed unit and handling any unexpected error case/type. (cherry picked from commit d8b1f1a) # Conflicts: # x-pack/libbeat/management/managerV2.go
BeatV2Manager `reload` method calls `reloadInputs`, however it did not handle the errors returned correctly. This commit fixes it by making `reloadInputs`, whenever possible, use a cfgfile.UnitError to indicate the failed unit and handling any unexpected error case/type. (cherry picked from commit d8b1f1a) # Conflicts: # x-pack/libbeat/management/managerV2.go
BeatV2Manager `reload` method calls `reloadInputs`, however it did not handle the errors returned correctly. This commit fixes it by making `reloadInputs`, whenever possible, use a cfgfile.UnitError to indicate the failed unit and handling any unexpected error case/type. (cherry picked from commit d8b1f1a)
BeatV2Manager `reload` method calls `reloadInputs`, however it did not handle the errors returned correctly. This commit fixes it by making `reloadInputs`, whenever possible, use a cfgfile.UnitError to indicate the failed unit and handling any unexpected error case/type. (cherry picked from commit d8b1f1a)
BeatV2Manager `reload` method calls `reloadInputs`, however it did not handle the errors returned correctly. This commit fixes it by making `reloadInputs`, whenever possible, use a cfgfile.UnitError to indicate the failed unit and handling any unexpected error case/type.
…45759) BeatV2Manager `reload` method calls `reloadInputs`, however it did not handle the errors returned correctly. This commit fixes it by making `reloadInputs`, whenever possible, use a cfgfile.UnitError to indicate the failed unit and handling any unexpected error case/type. (cherry picked from commit d8b1f1a) --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
…45760) BeatV2Manager `reload` method calls `reloadInputs`, however it did not handle the errors returned correctly. This commit fixes it by making `reloadInputs`, whenever possible, use a cfgfile.UnitError to indicate the failed unit and handling any unexpected error case/type. (cherry picked from commit d8b1f1a) * Fix merge conflicts * Fix merge conflict --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
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
Related issues
inputsinbeat-rendered-config.yaml) #43118## Use cases## Screenshots## Logs