Skip to content

Handle AMQPProtocolChannelException gracefully when node enters maintenance mode #634

@LorenzoRogai

Description

@LorenzoRogai

When using this package we occasionally see unhandled exceptions from PhpAmqpLib when a RabbitMQ node is put into maintenance mode.

Error details:
PhpAmqpLib\Exception\AMQPProtocolChannelException
CONNECTION_FORCED - Node was put into maintenance mode

/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AMQPChannel.php in PhpAmqpLib\Channel\AMQPChannel::channel_close

Problem:
Right now this exception bubbles up and crashes the worker in an uncontrolled way. In our case, this happens during maintenance operations and causes noisy error reporting

Suggested improvement:
Have the package handle this scenario more gracefully by letting the worker process die cleanly instead of throwing an unhandled exception (maybe configurable with a CLI command option)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions