Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 6, 2020

Conversation

gaelreyrol
Copy link
Contributor

@gaelreyrol gaelreyrol commented May 6, 2020

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