Skip to content

Commit

Permalink
winlogbeat: allow termination while attempting to open channels (#35474)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
efd6 authored May 16, 2023
1 parent f0215ff commit a927de0
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 @@ -206,6 +206,7 @@ automatic splitting at root level, if root level element is an array. {pull}3415
- Move repeated channel not found errors to debug level. {issue}35314[35314] {pull}35317[35317]
- Fix panic due to misrepresented buffer use. {pull}35437[35437]
- Prevent panic on closing iterators on empty channels in experimental API. {issue}33966[33966] {pull}35423[35423]
- 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 a927de0

Please sign in to comment.