aboutsummaryrefslogtreecommitdiff
path: root/weed/replication/sub
diff options
context:
space:
mode:
authorKonstantin Lebedev <lebedev_k@tochka.com>2021-02-10 15:29:05 +0500
committerKonstantin Lebedev <lebedev_k@tochka.com>2021-02-10 15:29:05 +0500
commit0cfed8c3cb8cd4e9e35310a0ce7621945e10ef70 (patch)
treea91589b0f985c8febe4890a8ae7941ab8556d18a /weed/replication/sub
parent770393a48c7c70084ae2f1bc510b8504d3b14aa4 (diff)
downloadseaweedfs-0cfed8c3cb8cd4e9e35310a0ce7621945e10ef70.tar.xz
seaweedfs-0cfed8c3cb8cd4e9e35310a0ce7621945e10ef70.zip
restart replication if RabbitMQ connection closed
https://github.com/google/go-cloud/issues/2958
Diffstat (limited to 'weed/replication/sub')
-rw-r--r--weed/replication/sub/notification_gocdk_pub_sub.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/replication/sub/notification_gocdk_pub_sub.go b/weed/replication/sub/notification_gocdk_pub_sub.go
index 413c0e3cf..1d7fe520b 100644
--- a/weed/replication/sub/notification_gocdk_pub_sub.go
+++ b/weed/replication/sub/notification_gocdk_pub_sub.go
@@ -113,6 +113,10 @@ func (k *GoCDKPubSubInput) Initialize(configuration util.Configuration, prefix s
func (k *GoCDKPubSubInput) ReceiveMessage() (key string, message *filer_pb.EventNotification, onSuccessFn func(), onFailureFn func(), err error) {
msg, err := k.sub.Receive(context.Background())
if err != nil {
+ var conn *amqp.Connection
+ if k.sub.As(&conn) && conn.IsClosed() {
+ glog.Fatalln(err)
+ }
return
}
onFailureFn = func() {