From 324a5449fbd37a15b7d1471462e2c241c083ca22 Mon Sep 17 00:00:00 2001 From: Chen Wenhao Date: Fri, 4 Jan 2019 22:39:39 +0800 Subject: [PATCH] Close handle on signalEvent (#9838) Close handle on signalEvent. Winlogbeat doesn't use the signalEvent but it's required to create the subscription. Winlogbeat polls the subscription every second rather than selecting on the signalEvent. --- CHANGELOG.next.asciidoc | 2 ++ winlogbeat/eventlog/wineventlog.go | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index ad2ab0cce9c..2babb36e3e6 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -122,6 +122,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d *Winlogbeat* +- Close handle on signalEvent. {pull}9838[9838] + *Functionbeat* ==== Known Issue diff --git a/winlogbeat/eventlog/wineventlog.go b/winlogbeat/eventlog/wineventlog.go index eec37549666..6a541784912 100644 --- a/winlogbeat/eventlog/wineventlog.go +++ b/winlogbeat/eventlog/wineventlog.go @@ -126,6 +126,7 @@ func (l *winEventLog) Open(state checkpoint.EventLogState) error { if err != nil { return nil } + defer windows.CloseHandle(signalEvent) debugf("%s using subscription query=%s", l.logPrefix, l.query) subscriptionHandle, err := win.Subscribe(