From 0c90918c3e1e16cb1ba6bb1834890f8b4ed8ad7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=A1gr?= Date: Wed, 7 Jun 2023 15:03:49 +0200 Subject: [PATCH] Don't attempt to close Sender on error Resolves: rhbz#2179924 --- connector/amqp10/amqp10.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/connector/amqp10/amqp10.go b/connector/amqp10/amqp10.go index befda16..ed7a327 100644 --- a/connector/amqp10/amqp10.go +++ b/connector/amqp10/amqp10.go @@ -542,11 +542,11 @@ func (conn *AMQP10Connector) Start(outchan chan interface{}, inchan chan interfa } else { if s, err := conn.CreateSender(message.Address); err != nil { conn.logger.Metadata(logging.Metadata{ - "cause": "creating sender failed", - "reason": err, + "cause": "creating sender failed", + "reason": err, + "address": message.Address, }) conn.logger.Warn("Skipping processing message") - (*s).Close(nil) lfLock.Lock() linkFail += 1 @@ -562,8 +562,9 @@ func (conn *AMQP10Connector) Start(outchan chan interface{}, inchan chan interfa if err := (*sender).Error(); err != nil { // verify sender connection conn.logger.Metadata(logging.Metadata{ - "cause": "sender disconnected", - "reason": err, + "cause": "sender disconnected", + "reason": err, + "address": message.Address, }) conn.logger.Warn("Skipping processing message")