Skip to content

Consumer connection recovery does not stop on success when RabbitMQ node is restarted #1061

@Inlustris

Description

@Inlustris

For easy understanding of the problem.
With the connectionfactory i create a Consumer and Publisher connection. No changes in the default settings of the connection or connectionfactory. Which should result in auto recovery of the connection.

ConsumerConnection = AutoRecoverable

  • 3 active consumers (channels)

PublisherConnection = AutoRecoverable

  • none active channels

For testing purposes i was restarting rabbitMQ.

While logging for the ShutdownConnection event resulted in "CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'". (this is off course a logical outcome)

Within rabbitMQ my connection looks like the following table:

Network Name User name State SSL / TLS Protocol Channels From client To client
172.17.0.1:40406 Consumers user running AMQP 0-9-1 3 2 B/s 0 B/s
172.17.0.1:40412 Publishers user running AMQP 0-9-1 0 2 B/s 0 B/s

When i restart rabbitMQ it start trying to recover like in the document:

  • Reconnect
  • Restore connection listeners
  • Re-open channels
  • Restore channel listeners
  • Restore channel basic.qos setting, publisher confirms and transaction settings

The result is that it recreates my connections for this application with the channels.
But the result is that my publishing connection is reacreated with 0 channels which is right. but my Consumer connection gets recreated with 3 channels. Which is at this point right too.

Now my issue it doesn't recover this consumer connection correctly. It is being recreated like every 5 to 10 seconds. Which results in x amount of connections. All with the correct 3 channels but none of them function like fully recovered.

Example of the results after restart: (1 Publish Connection, X amount of consumer Connections)

Network Name User name State SSL / TLS Protocol Channels From client To client
172.17.0.1:40586 Publishers user running AMQP 0-9-1 0 2 iB/s 0 B/s
172.17.0.1:40592 Consumers user running AMQP 0-9-1 3 2 iB/s 0 B/s
172.17.0.1:40604 Consumers user running AMQP 0-9-1 3 0 B/s 0 B/s
172.17.0.1:40610 Consumers user running AMQP 0-9-1 3 0 B/s 0 B/s
172.17.0.1:40616 Consumers user running AMQP 0-9-1 3 2 iB/s 0 B/s
172.17.0.1:40628 Consumers user running AMQP 0-9-1 3 0 B/s 2 iB/s
172.17.0.1:40634 Consumers user running AMQP 0-9-1 3 0 B/s 0 B/s
172.17.0.1:40640 Consumers user running AMQP 0-9-1 3 2 iB/s 0 B/s
172.17.0.1:40646 Consumers user running AMQP 0-9-1 3 0 B/s 0 B/s

RabbitMQ logging repeating itself:

2021-07-29 20:02:58.084 [info] <0.2125.0> accepting AMQP connection <0.2125.0> (172.17.0.1:38276 -> 172.17.0.4:5672)
2021-07-29 20:02:58.086 [info] <0.2125.0> Connection <0.2125.0> (172.17.0.1:38276 -> 172.17.0.4:5672) has a client-provided name: Consumers
2021-07-29 20:02:58.088 [info] <0.2125.0> connection <0.2125.0> (172.17.0.1:38276 -> 172.17.0.4:5672 - Consumers): user 'user' authenticated and granted access to vhost '/'

2021-07-29 20:03:03.142 [info] <0.2150.0> accepting AMQP connection <0.2150.0> (172.17.0.1:38282 -> 172.17.0.4:5672)
2021-07-29 20:03:03.961 [info] <0.2150.0> Connection <0.2150.0> (172.17.0.1:38282 -> 172.17.0.4:5672) has a client-provided name: Consumers
2021-07-29 20:03:03.963 [info] <0.2150.0> connection <0.2150.0> (172.17.0.1:38282 -> 172.17.0.4:5672 - Consumers): user 'user' authenticated and granted access to vhost '/'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions