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

[8.x] Retry connection if DNS resolution fails #35786

Closed
wants to merge 1 commit into from

Conversation

deleugpn
Copy link
Contributor

@deleugpn deleugpn commented Jan 5, 2021

Recently I've been investigating some connection failures:

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known (SQL: select * from ...)

Upon investigation, I noticed that this happened about 36 times out of 130,396 requests in. Although extremely low (0.02%), it is still quite disruptive to have some requests throwing 500 Internal Server Error and writing database connection logs.
AWS Support has informed that due to transient network issues, it is possible that an extremely small number of connections to RDS or Elasticache might fail and that their engineers are always working on trying to reduce even further these errors. Since it's a rare event of connectivity issues, retrying the connection seem to be a viable option and doing this on my own project seems to be so much harder than using Laravel's built-in system for reconnection.

@GrahamCampbell
Copy link
Member

This should target the 6.x branch. :)

@driesvints
Copy link
Member

Yep, indeed. @deleugpn can you send this to 6.x?

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.

3 participants