跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[PHP] 有用 Laravel + supervisor 用队列的么,有碰到过进程多了以后 kill -TERM $pid 不退出的么

发表于

描述一下问题:

supervisor 起了几百个消费进程都是 php artisan queue:work --queue=每个不一样

理论上,发送 TERM 信号给 supervisor ,它会挨个发送给每个进程,然后 laravel 本身也处理了 term 信号,会在当前正在处理的 job 处理完后自动退出进程,并且 exitcode 是 0

但是经过实际测试,给 supervisor 进程发送 TERM 信号后,的确所有进程都陆续退出了,但是,唯独有那十几个进程,每次都是在其他所有进程结束后都又过了十几秒才开始陆续退出。

在 vendor/laravel/framework/src/illuminate/queue/worker.php 给信号处理、标记退出 flag 、while popjob 等几处,挨个打了个日志。

根据日志结果,也确实证明这十几个进程确实是压根儿没收到 term 信号,在其他进程都退出完成后的十几秒后,才收到了来自 supervisor 的 term 信号。

没啥排查思路了...

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.