aboutsummaryrefslogtreecommitdiff
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
parent770393a48c7c70084ae2f1bc510b8504d3b14aa4 (diff)
downloadseaweedfs-0cfed8c3cb8cd4e9e35310a0ce7621945e10ef70.tar.xz
seaweedfs-0cfed8c3cb8cd4e9e35310a0ce7621945e10ef70.zip
restart replication if RabbitMQ connection closed
https://github.com/google/go-cloud/issues/2958
-rw-r--r--docker/compose/notification.toml (renamed from docker/notification.toml)0
-rw-r--r--docker/compose/replication.toml (renamed from docker/replication.toml)0
-rw-r--r--weed/replication/sub/notification_gocdk_pub_sub.go4
3 files changed, 4 insertions, 0 deletions
diff --git a/docker/notification.toml b/docker/compose/notification.toml
index dcd5f2c6f..dcd5f2c6f 100644
--- a/docker/notification.toml
+++ b/docker/compose/notification.toml
diff --git a/docker/replication.toml b/docker/compose/replication.toml
index 833bb1692..833bb1692 100644
--- a/docker/replication.toml
+++ b/docker/compose/replication.toml
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() {