Skip to content

Commit 42a98ef

Browse files
committed
Added a Postgres lost connection error message string
In Postgres 9.4.*, if the connection to the database is killed and I trigger a queued job, the DB Connection class throws an error and doesn't retry. This is the error that occurs: ``` SomeQueuedJob error: SQLSTATE[HY000]: General error: 7 server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. (SQL: select * from "table" where "id" = 1 limit 1) [/var/www/html/vendor/illuminate/database/Connection.php:651] ``` I've added an additional string to the DetectsLostConnections class to catch this error so the application will retry the connection.
1 parent 2c1abfc commit 42a98ef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Illuminate/Database/DetectsLostConnections.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ protected function causedByLostConnection(Exception $e)
2424
'is dead or not enabled',
2525
'Error while sending',
2626
'decryption failed or bad record mac',
27+
'server closed the connection unexpectedly',
2728
'SSL connection has been closed unexpectedly',
2829
'Deadlock found when trying to get lock',
2930
'Error writing data to the connection',

0 commit comments

Comments
 (0)