使用了laravel定时任务中的 withoutOverlapping() 特性引发了一个bug,导致某个定时任务被无故终止。
$schedule->command('behavior:behavior_stat_daily')->withoutOverlapping()->everyTenMinutes();
查询crontab执行日志发现某个时间点因为redis内网闪断链接故障,导致key未被释放。
No scheduled commands are ready to run.
No scheduled commands are ready to run.
Running scheduled command: '/usr/bin/php' artisan behavior:behavior_stat_daily > '/dev/null' 2>&1
In AbstractConnection.php line 155:
Error while reading line from the server. [tcp://r-b******64.redis.rds.aliyuncs.com:6379]
No scheduled commands are ready to run.
No scheduled commands are ready to run.
但是因为使用了redis缓存,所以一时间找不到定时任务的使用了哪个缓存互斥锁的key。
这个是调度器中