Skip to content

[6.x] Add SSL SYSCALL EOF as a lost connection message#32697

Merged
taylorotwell merged 1 commit into
laravel:6.xfrom
dansmaculotte:ssl-syscall-eof
May 6, 2020
Merged

[6.x] Add SSL SYSCALL EOF as a lost connection message#32697
taylorotwell merged 1 commit into
laravel:6.xfrom
dansmaculotte:ssl-syscall-eof

Conversation

@gaelreyrol

@gaelreyrol gaelreyrol commented May 6, 2020

Copy link
Copy Markdown
Contributor

From #32696, following @GrahamCampbell request :)

As Laravel get's deployed everywhere and to Clever Cloud, we started to get errors from long running workers trying to execute jobs having DB queries.
When a worker has not executed anything in a while, the first job fails with this error while the next ones runs fine.

SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: EOF detected (SQL: select * from "an_example_table")

Our investigation shows that the connection is closed by the server because it was not used and we fixed it by adding these calls inspired by Heroku's recommandations:

Queue::before(function (JobProcessing $event) {
    DB::connection()->reconnect();
});

Queue::after(function (JobProcessed $event) {
    DB::connection()->disconnect();
});

Queue::failing(function (JobFailed $event) {
    DB::connection()->disconnect();
});

But we tought that Laravel might consider this as a try again message.

PS: Maybe the message is too specific and should be more generic: SSL SYSCALL error: EOF detected.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants