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

Queue don’t gracefully exit when running Artisan::call inside a Job #47724

Closed
ChristopheBorcard opened this issue Jul 12, 2023 · 1 comment
Closed

Comments

@ChristopheBorcard
Copy link
Contributor

ChristopheBorcard commented Jul 12, 2023

Laravel Version

10.14.1

PHP Version

8.2.6

Database Driver & Version

not relevant

Description

Since this commit , running an Artisan::call() in a Job overwrites the PCNTL signal management of the worker:queue with that of Symfony.

This makes it possible to stop worker processes instantly without finishing the current Job.

This creates a lot of problems when using Horizon in "auto" mode.

Steps To Reproduce

  1. Create a simple job like:
public function handle(): void
{
    Log::debug('Job start');
    Artisan::call('about');
    Log::debug('Start waiting');
    sleep(60);
    Log::debug('Job terminated');
}
  1. Start the command queue:worker
  2. Insert your job
  3. Send a sigterm to the queue:worker process
  4. The job will exit before the last log: Job terminated
@driesvints
Copy link
Member

PR was merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants