-
Notifications
You must be signed in to change notification settings - Fork 702
Description
Horizon Version
5.40.1
Laravel Version
11.46.1|12.10.1
PHP Version
8.4.14
Redis Driver
PhpRedis
Redis Version
phpRedis 6.3.0
Database Driver & Version
pdo_sqlsrv 5.12.0,ODBC Driver 18 for SQL Server 18.5.1.1
Description
supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'auto',
'autoScalingStrategy' => 'time',
'maxProcesses' => 10,
'maxTime' => 0,
'maxJobs' => 0,
'memory' => 128,
'balanceMaxShift' => 1,
'balanceCooldown' => 3,
'tries' => 1,
'timeout' => 60,
'nice' => 0,
],
当新创建进程时总会触发失败的任务,抛出以下异常
SQLSTATE[08S01]: [Microsoft][ODBC Driver 18 for SQL Server]TCP Provider: Error code 0x2714 (Connection: sqlsrv, SQL: WAITFOR DELAY '00:00:30'; SELECT 1 as result)
Steps To Reproduce
class Test08S01Exception1Job implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $timeout = 80;
/**
* 执行job
*/
public function handle()
{
$job = 'Job:' . $this->job->getJobId();
Log::info("{$job} start");
try {
$sql = "WAITFOR DELAY '00:00:30'; SELECT 1 as result";
DB::connection('sqlsrv')->select($sql);
Log::info("{$job} end");
} catch (\Exception $e) {
Log::error("{$job} Exception", [
'exception' => get_class($e),
'message' => $e->getMessage(),
'code' => $e->getCode()
]);
throw $e;
}
}
}
web路由中增加
Route::get('/test-08S01', function () {
\App\Jobs\Test08S01Exception1Job::dispatch();
return "successfully";
});
当并发处理任务时就会出现异常