From 94a4608d3b546c87065f9b5614e3ac29b976730a Mon Sep 17 00:00:00 2001 From: Vihas Makwana Date: Tue, 8 Oct 2024 22:07:27 +0530 Subject: [PATCH 1/2] fix: fix remote session leak while resubscribing --- pkg/stanza/operator/input/windows/input.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/stanza/operator/input/windows/input.go b/pkg/stanza/operator/input/windows/input.go index 312709fc863e..e0324826e43f 100644 --- a/pkg/stanza/operator/input/windows/input.go +++ b/pkg/stanza/operator/input/windows/input.go @@ -201,6 +201,9 @@ func (i *Input) read(ctx context.Context) { i.Logger().Error("Failed to close remote subscription", zap.Error(closeErr)) return } + if err := i.stopRemoteSession(); err != nil { + i.Logger().Error("Failed to close remote session", zap.Error(err)) + } i.Logger().Info("Resubscribing, creating remote subscription") i.subscription = NewRemoteSubscription(i.remote.Server) if err := i.startRemoteSession(); err != nil { From b5159d205c58e7e049bb4796b525fbd4042fc11a Mon Sep 17 00:00:00 2001 From: Vihas Makwana Date: Tue, 8 Oct 2024 22:15:22 +0530 Subject: [PATCH 2/2] chore: changelog --- .../stanza-windows-remote-session-leak.yaml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .chloggen/stanza-windows-remote-session-leak.yaml diff --git a/.chloggen/stanza-windows-remote-session-leak.yaml b/.chloggen/stanza-windows-remote-session-leak.yaml new file mode 100644 index 000000000000..96200a5659f5 --- /dev/null +++ b/.chloggen/stanza-windows-remote-session-leak.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: stanza/input/windows + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Close remote session while resubscribing + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [35577] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: []