Skip to content

Commit

Permalink
Don't attempt to close Sender on error
Browse files Browse the repository at this point in the history
Resolves: rhbz#2179924
  • Loading branch information
paramite committed Jun 8, 2023
1 parent 00d2af2 commit 0c90918
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions connector/amqp10/amqp10.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")

Expand Down

0 comments on commit 0c90918

Please sign in to comment.