Skip to content

amqp-interop with enqueue/amqp-lib not responding to SIGINT #379

@Tarinu

Description

@Tarinu

What steps will reproduce the problem?

  1. Make sure PCNTL extension is installed.
  2. Configure queue using enqueue/amqp-lib so it can create the connection with RabbitMQ
    return [
        'bootstrap' => ['queue'],
        'components' => [
            'queue' => [
                'class' => \yii\queue\amqp_interop\Queue::class,
                'driver' => yii\queue\amqp_interop\Queue::ENQUEUE_AMQP_LIB,
                'host' => 'localhost',
                'port' => 5672,
                'user' => 'guest',
                'password' => 'guest',
                'queueName' => 'test',
            ],
        ],
    ];
  3. Run php yii queue/listen
  4. Send SIGINT (CTRL+C)

What's expected?

Listener should stop running

What do you get instead?

Nothing happens, disconnect event isn't sent to RabbitMQ.

Additional info

Queue is completely empty so it's not waiting for a job to finish before exiting.

This seems to happen because amqp-tools overwrites these signals with custom handlers. Setting up handlers as described in php-amqplib docs seems to stop the process as I'd expect it to.

Q A
Yii version 2.0.35
Yii-queue version 2.3.0
enqueue/amqp-lib version 0.10.1
PHP version 7.4.5
Operating system Debian 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions