Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(relayer): cherry pick a6 c1ed8b7fc974f7feac2c19ae4481bb831000d000 #15882

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions packages/relayer/pkg/queue/rabbitmq/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ func (r *RabbitMQ) connect() error {
r.conn = conn
r.ch = ch

r.connErrCh = r.conn.NotifyClose(make(chan *amqp.Error, 1))
r.connErrCh = r.conn.NotifyClose(make(chan *amqp.Error))

r.chErrCh = r.ch.NotifyClose(make(chan *amqp.Error, 1))
r.chErrCh = r.ch.NotifyClose(make(chan *amqp.Error))

r.subscriptionCtx, r.subscriptionCancel = context.WithCancel(context.Background())

Expand Down Expand Up @@ -208,10 +208,20 @@ func (r *RabbitMQ) Notify(ctx context.Context, wg *sync.WaitGroup) error {

return nil
case err := <-r.connErrCh:
slog.Error("rabbitmq notify close connection", "err", err.Error())
if err != nil {
slog.Error("rabbitmq notify close connection", "err", err.Error())
} else {
slog.Error("rabbitmq notify close connection")
}

return queue.ErrClosed
case err := <-r.chErrCh:
slog.Error("rabbitmq notify close channel", "err", err.Error())
if err != nil {
slog.Error("rabbitmq notify close channel", "err", err.Error())
} else {
slog.Error("rabbitmq notify close channel")
}

return queue.ErrClosed
case returnMsg := <-r.notifyReturnCh:
slog.Error("rabbitmq notify return", "id", returnMsg.MessageId, "err", returnMsg.ReplyText)
Expand Down
Loading