Skip to content

Commit

Permalink
[8.7](backport #35474) winlogbeat: allow termination while attempting…
Browse files Browse the repository at this point in the history
… to open channels (#35491)

* winlogbeat: allow termination while attempting to open channels (#35474)

Currently, if winlogbeat is attempting to open a channel that is not
available because it is not found or there is a recoverable error, it
will loop and retry. Since signals have been sent to notification
handlers by this point, cancellation of the loop is not possible without
agreement. So add a cancellation select at the head of the retry loop to
allow termination.

(cherry picked from commit a927de0)

* Update CHANGELOG.next.asciidoc

---------

Co-authored-by: Dan Kortschak <90160302+efd6@users.noreply.github.com>
  • Loading branch information
mergify[bot] and efd6 authored May 16, 2023
1 parent dbde0c4 commit 11c6656
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ https://github.com/elastic/beats/compare/v8.7.1\...main[Check the HEAD diff]

- Fix crash when processing forwarded logs missing a message. {issue}34705[34705] {pull}34865[34865]
- Move repeated channel not found errors to debug level. {issue}35314[35314] {pull}35317[35317]
- Allow program termination when attempting to open an absent channel. {pull}35474[35474]

*Functionbeat*

Expand Down
6 changes: 6 additions & 0 deletions winlogbeat/beater/eventlogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ func (e *eventLogger) run(

runLoop:
for stop := false; !stop; {
select {
case <-done:
return
default:
}

err = api.Open(state)

switch {
Expand Down

0 comments on commit 11c6656

Please sign in to comment.