From 10115c0c7938390f5b773b9e876594028389e550 Mon Sep 17 00:00:00 2001 From: Leszek Charkiewicz Date: Tue, 31 Dec 2024 18:02:43 +0100 Subject: [PATCH] Prevent panicking when SQS consumer is disabled (#50646) --- lib/events/athena/athena.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/events/athena/athena.go b/lib/events/athena/athena.go index c72c92daf91cc..00556ac2ed00f 100644 --- a/lib/events/athena/athena.go +++ b/lib/events/athena/athena.go @@ -543,7 +543,11 @@ func (l *Log) SearchSessionEvents(ctx context.Context, req events.SearchSessionE } func (l *Log) Close() error { - return trace.Wrap(l.consumerCloser.Close()) + // consumerCloser is nil when consumer is disabled. + if l.consumerCloser != nil { + return trace.Wrap(l.consumerCloser.Close()) + } + return nil } func (l *Log) IsConsumerDisabled() bool {