Skip to content

v0.2.0

Choose a tag to compare

@skybleak333 skybleak333 released this 16 Oct 11:11

Second experiment: what queue:work and rabbitmq:consume do when RabbitMQ stops answering but TCP stays up. The broker is frozen with docker compose pause for 100 s while idle workers with a 15 s heartbeat wait for jobs.

  • queue:work waits in basic_get until the broker is back: channel_rpc_timeout defaults to 0, and a wait without a timeout never gets to php-amqplib's heartbeat checks. --timeout and --max-time don't cover this wait either.
  • With heartbeats and a 10 s channel_rpc_timeout, queue:work stops after 42 s with LostConnection and exit code 0. The same timeout without heartbeats only reports an error every 14 s.
  • rabbitmq:consume doesn't notice: its non-blocking poll counts the client's own heartbeats as activity (vyuldashev/laravel-queue-rabbitmq#673). With --max-time it stops consuming but can't close the channel until the broker is back; with channel_rpc_timeout it exits with code 1.

Other changes:

  • The lab uses the package's default connection path. LAB_HEARTBEAT, LAB_IO_TIMEOUT and LAB_RPC_TIMEOUT set the connection options of a process.
  • bin/lab artisan handles an exception from a command like php artisan in an application: it reports and prints it and exits with code 1.
  • The results of experiment 1 are the same.

Checked in CI with PHP 8.3–8.5, Laravel 13.37, php-amqplib 3.7.5 and RabbitMQ 3.13.3. Until vyuldashev/laravel-queue-rabbitmq#680 is released, the package is installed from its branch.