Skip to content

Commit

Permalink
[8.14](backport elastic#39781) [winlogbeat] Recover from error 87 if …
Browse files Browse the repository at this point in the history
…found (elastic#39872)

* Recover from error 87 if found (elastic#39781)

(cherry picked from commit d535d17)

* Update CHANGELOG.next.asciidoc

---------

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>
  • Loading branch information
mergify[bot] and marc-gr authored Jun 12, 2024
1 parent c74896e commit 9ce6c93
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]

*Winlogbeat*

- Add ERROR_INVALID_PARAMETER to the list of recoverable errors. {pull}39781[39781]

*Functionbeat*

Expand Down
4 changes: 3 additions & 1 deletion winlogbeat/eventlog/errors_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import (
//
//nolint:errorlint // These are never wrapped.
func IsRecoverable(err error) bool {
return err == win.ERROR_INVALID_HANDLE || err == win.RPC_S_SERVER_UNAVAILABLE || err == win.RPC_S_CALL_CANCELLED || err == win.ERROR_EVT_QUERY_RESULT_STALE
return err == win.ERROR_INVALID_HANDLE || err == win.RPC_S_SERVER_UNAVAILABLE ||
err == win.RPC_S_CALL_CANCELLED || err == win.ERROR_EVT_QUERY_RESULT_STALE ||
err == win.ERROR_INVALID_PARAMETER
}

// IsChannelNotFound returns true if the error indicates the channel was not found.
Expand Down
1 change: 1 addition & 0 deletions winlogbeat/sys/wineventlog/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const NilHandle EvtHandle = 0
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx
const (
ERROR_INVALID_HANDLE syscall.Errno = 6
ERROR_INVALID_PARAMETER syscall.Errno = 87
ERROR_INSUFFICIENT_BUFFER syscall.Errno = 122
ERROR_NO_MORE_ITEMS syscall.Errno = 259
RPC_S_SERVER_UNAVAILABLE syscall.Errno = 1722
Expand Down

0 comments on commit 9ce6c93

Please sign in to comment.