You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
php artisan queue:work stopping after Http client throws exception, as I investigated, causedByLostConnection is getting true, but actually queue driver connection has not lost connection, http client couldn't connect. So, I caught error in job and rethrow it with different signature and now queue:work is continuing working
Steps To Reproduce:
Just create a simple job, connect to port which is not serving anything with http client, try with this code, it should fail and exit, and then uncomment commented codes, worker should work as expected without exiting.
publicfunctionhandle()
{
// try {$response = Http::post($this->callback_url, [
'id' => $this->id,
'result' => $this->result
]);
if ($response->successful()) {
$this->entity->update(['delivered' => 1]);
}
// } catch (\Exception $e) {// throw new \Exception("Server has not returned successful response code");// }
}
Additional information:
Exception message is
cURL error 7: Failed to connect to localhost port 5000: Connection refused
Hmm looks like a genuine bug. It was intended to prevent DB disconnects on DB driver queue workers but apparently the curl error returns the same string that's used to detect DB lost connections. This line is causing the worker to stop:
Description:
php artisan queue:work
stopping after Http client throws exception, as I investigated,causedByLostConnection
is getting true, but actually queue driver connection has not lost connection, http client couldn't connect. So, I caught error in job and rethrow it with different signature and nowqueue:work
is continuing workingSteps To Reproduce:
Just create a simple job, connect to port which is not serving anything with http client, try with this code, it should fail and exit, and then uncomment commented codes, worker should work as expected without exiting.
Additional information:
Exception message is
I think this is causing problem.
The text was updated successfully, but these errors were encountered: