Skip to content

Commit 0b96d40

Browse files
authored
fix(outputs/amqp): Close the last connection when writing error to avoid connection leaks (#10360)
1 parent c353bac commit 0b96d40

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

plugins/outputs/amqp/amqp.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ func (q *AMQP) Write(metrics []telegraf.Metric) error {
260260
return err
261261
}
262262
} else {
263+
if err := q.client.Close(); err != nil {
264+
q.Log.Errorf("Closing connection failed: %v", err)
265+
}
263266
q.client = nil
264267
return err
265268
}

0 commit comments

Comments
 (0)