From 5386ce00d0e26b25529f27cbbb0784cca7c3422d Mon Sep 17 00:00:00 2001 From: Ogulcan Aydogan Date: Mon, 2 Nov 2026 21:07:24 +0000 Subject: [PATCH 1/2] fix(logging): pass the fluentd default retry wait in milliseconds The fluent logger expects RetryWait in milliseconds. A set fluentd-retry-wait was converted with Milliseconds(), but the default was int(1000 * time.Millisecond), which is 1000000000. Without the option the retry delay was far above the logger's maximum, so it always waited the maximum instead of one second. Use the default in milliseconds and have the tests check it. Signed-off-by: Ogulcan Aydogan --- pkg/logging/fluentd_logger.go | 2 +- pkg/logging/fluentd_logger_test.go | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/logging/fluentd_logger.go b/pkg/logging/fluentd_logger.go index e281b6dbf2a..15d6e5b3e3b 100644 --- a/pkg/logging/fluentd_logger.go +++ b/pkg/logging/fluentd_logger.go @@ -233,7 +233,7 @@ func parseFluentdConfig(config map[string]string) (fluent.Config, error) { } bufferLimit = int(parsedBufferLimit) } - retryWait := int(defaultRetryWait) + retryWait := int(defaultRetryWait.Milliseconds()) if config[fluentdRetryWait] != "" { temp, err := time.ParseDuration(config[fluentdRetryWait]) if err != nil { diff --git a/pkg/logging/fluentd_logger_test.go b/pkg/logging/fluentd_logger_test.go index 8da21192d22..8ef4b11ec3b 100644 --- a/pkg/logging/fluentd_logger_test.go +++ b/pkg/logging/fluentd_logger_test.go @@ -94,7 +94,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: defaultBufferLimit, - RetryWait: int(defaultRetryWait), + RetryWait: 1000, // The fluent logger takes milliseconds., MaxRetry: defaultMaxRetries, Async: false, AsyncReconnectInterval: 0, @@ -110,7 +110,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: defaultBufferLimit, - RetryWait: int(defaultRetryWait), + RetryWait: int(defaultRetryWait.Milliseconds()), MaxRetry: defaultMaxRetries, Async: false, AsyncReconnectInterval: 0, @@ -127,7 +127,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: defaultBufferLimit, - RetryWait: int(defaultRetryWait), + RetryWait: int(defaultRetryWait.Milliseconds()), MaxRetry: defaultMaxRetries, Async: true, AsyncReconnectInterval: 0, @@ -143,7 +143,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: defaultBufferLimit, - RetryWait: int(defaultRetryWait), + RetryWait: int(defaultRetryWait.Milliseconds()), MaxRetry: defaultMaxRetries, Async: false, AsyncReconnectInterval: 100, @@ -159,7 +159,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: 1000, - RetryWait: int(defaultRetryWait), + RetryWait: int(defaultRetryWait.Milliseconds()), MaxRetry: defaultMaxRetries, Async: false, AsyncReconnectInterval: 0, @@ -191,7 +191,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: defaultBufferLimit, - RetryWait: int(defaultRetryWait), + RetryWait: int(defaultRetryWait.Milliseconds()), MaxRetry: 100, Async: false, AsyncReconnectInterval: 0, @@ -207,7 +207,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: defaultBufferLimit, - RetryWait: int(defaultRetryWait), + RetryWait: int(defaultRetryWait.Milliseconds()), MaxRetry: defaultMaxRetries, Async: false, AsyncReconnectInterval: 0, @@ -223,7 +223,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: defaultBufferLimit, - RetryWait: int(defaultRetryWait), + RetryWait: int(defaultRetryWait.Milliseconds()), MaxRetry: defaultMaxRetries, Async: false, AsyncReconnectInterval: 0, @@ -239,7 +239,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: defaultBufferLimit, - RetryWait: int(defaultRetryWait), + RetryWait: int(defaultRetryWait.Milliseconds()), MaxRetry: defaultMaxRetries, Async: false, AsyncReconnectInterval: 0, From dedf0ecd3800a4280a72e89dcccc2443c88c9697 Mon Sep 17 00:00:00 2001 From: Ogulcan Aydogan Date: Fri, 27 Nov 2026 19:42:37 +0000 Subject: [PATCH 2/2] test(logging): fix a comma in a comment Remove a stray comma at the end of a comment in the fluentd config test. Signed-off-by: Ogulcan Aydogan --- pkg/logging/fluentd_logger_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/logging/fluentd_logger_test.go b/pkg/logging/fluentd_logger_test.go index 8ef4b11ec3b..4d74153d947 100644 --- a/pkg/logging/fluentd_logger_test.go +++ b/pkg/logging/fluentd_logger_test.go @@ -94,7 +94,7 @@ func TestParseFluentdConfig(t *testing.T) { FluentNetwork: defaultProtocol, FluentSocketPath: "", BufferLimit: defaultBufferLimit, - RetryWait: 1000, // The fluent logger takes milliseconds., + RetryWait: 1000, // The fluent logger takes milliseconds. MaxRetry: defaultMaxRetries, Async: false, AsyncReconnectInterval: 0,