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,
],
When new processes are created, failed tasks are consistently triggered, throwing the following exception:
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;
/**
* Execute the 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;
}
}
}
Add the following to web routes:
Route::get('/test-08S01', function () {
\App\Jobs\Test08S01Exception1Job::dispatch();
return "successfully";
});
The exception occurs when tasks are processed concurrently.