From 3657aa94ccbd3df5b0f24d5d639eb33e0960cec6 Mon Sep 17 00:00:00 2001 From: Hein Date: Wed, 30 Sep 2026 12:40:22 +0200 Subject: [PATCH] fix(dbmanager): explicitly ignore best-effort listener close errors Co-Authored-By: Claude Sonnet 5.5 --- pkg/dbmanager/providers/postgres_listener.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/dbmanager/providers/postgres_listener.go b/pkg/dbmanager/providers/postgres_listener.go index ee9e48f..55d950e 100644 --- a/pkg/dbmanager/providers/postgres_listener.go +++ b/pkg/dbmanager/providers/postgres_listener.go @@ -108,7 +108,7 @@ func (l *PostgresListener) dial(ctx context.Context) (*pgx.Conn, error) { // Test the connection if err = conn.Ping(ctx); err != nil { lastErr = err - closeConnBounded(conn) + _ = closeConnBounded(conn) if l.config.GetEnableLogging() { logger.Warn("Failed to ping PostgreSQL listener: %v", err) } @@ -412,13 +412,13 @@ func (l *PostgresListener) reconnect(ctx context.Context) error { for _, ch := range channels { if _, err := conn.Exec(ctx, fmt.Sprintf("LISTEN %s", pgx.Identifier{ch}.Sanitize())); err != nil { - closeConnBounded(conn) + _ = closeConnBounded(conn) return fmt.Errorf("failed to resubscribe to channel %s: %w", ch, err) } } if l.ctx.Err() != nil { - closeConnBounded(conn) + _ = closeConnBounded(conn) return l.ctx.Err() } l.swapConn(conn) @@ -434,7 +434,7 @@ func (l *PostgresListener) swapConn(conn *pgx.Conn) { l.conn = conn l.mu.Unlock() if old != nil { - closeConnBounded(old) + _ = closeConnBounded(old) } l.connMu.Unlock() }