Catch ConnectionForced Exception

Occasionally I saw large number of connectionforced exceptions.
such exceptions cannot be healed automatically and requires a reboot.
catch it and ensure connection established.

Change-Id: I5c468d10230f05438df780e045f1e92662edf070
Closes-Bug: #1883038
(cherry picked from commit 26e8bb4cc9)
changes/47/743647/1 12.1.3
shenjiatong 2020-06-30 08:56:26 +08:00 committed by norman shen
parent 6727be7890
commit 360deb89a7
1 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,7 @@ import threading
import time
import uuid
from amqp import exceptions as amqp_exec
import kombu
import kombu.connection
import kombu.entity
@ -1012,7 +1013,8 @@ class Connection(object):
except (socket.timeout,
kombu.exceptions.OperationalError) as exc:
amqp_exec.ConnectionForced) as exc:"A recoverable connection/channel error "
"occurred, trying to reconnect: %s", exc)