From 1f02019b57829467555729859c1a2b1c46638541 Mon Sep 17 00:00:00 2001 From: David De Leon <56207066+davidadeleon@users.noreply.github.com> Date: Tue, 23 Aug 2022 14:49:56 -0400 Subject: [PATCH 1/3] Use specific client with longer timeout for log debug target --- command/debug.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/command/debug.go b/command/debug.go index 8213507cdf9f..71e1a97c8da7 100644 --- a/command/debug.go +++ b/command/debug.go @@ -1071,7 +1071,18 @@ func (c *DebugCommand) writeLogs(ctx context.Context) { } defer out.Close() - logCh, err := c.cachedClient.Sys().Monitor(ctx, "trace", c.logFormat) + // Create Monitor specific client based on the cached client + mClient, err := c.cachedClient.Clone() + if err != nil { + c.captureError("log", err) + return + } + mClient.SetToken(c.cachedClient.Token()) + + // Set timeout to match the context explicitly + mClient.SetClientTimeout(c.flagDuration + debugDurationGrace) + + logCh, err := mClient.Sys().Monitor(ctx, "trace", c.logFormat) if err != nil { c.captureError("log", err) return From e9ebfbfc69a2c3b6fd8b8808ba50873b90eba936 Mon Sep 17 00:00:00 2001 From: David De Leon <56207066+davidadeleon@users.noreply.github.com> Date: Tue, 23 Aug 2022 15:00:06 -0400 Subject: [PATCH 2/3] add changelog --- changelog/16834.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/16834.txt diff --git a/changelog/16834.txt b/changelog/16834.txt new file mode 100644 index 000000000000..7c6450b5ac69 --- /dev/null +++ b/changelog/16834.txt @@ -0,0 +1,3 @@ +```release-note:bug +debug: Fix issue when capturing logs for debug duration longer than 2 minutes +``` \ No newline at end of file From 05f4bf0d28063562c21ae082ee1ea6f60e196c22 Mon Sep 17 00:00:00 2001 From: David De Leon <56207066+davidadeleon@users.noreply.github.com> Date: Tue, 23 Aug 2022 15:35:59 -0400 Subject: [PATCH 3/3] update changelog entry --- changelog/16834.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/16834.txt b/changelog/16834.txt index 7c6450b5ac69..70c7d341b605 100644 --- a/changelog/16834.txt +++ b/changelog/16834.txt @@ -1,3 +1,3 @@ ```release-note:bug -debug: Fix issue when capturing logs for debug duration longer than 2 minutes +command/debug: fix bug where monitor was not honoring configured duration ``` \ No newline at end of file