Skip to content

Conversation

@josevalim
Copy link
Member

No description provided.

@josevalim
Copy link
Member Author

@greg-rychlewski here are the changes. The idea is that, when PostgresSQL detects the connection was dropped, we can now return :disconnect_and_retry. However, notice we cannot always do this, as a connection may drop in the middleware of a query, and we could retry something dangerous. Therefore, we can only emit retry when preparing/binding queries or issuing begin statements and so on. I am starting with a checkout retries of 3 but for the Neon case we may want to set it to the pool size + 1.

@josevalim josevalim merged commit ce227e0 into master Nov 9, 2025
2 checks passed
@josevalim
Copy link
Member Author

💚 💙 💜 💛 ❤️

@josevalim josevalim deleted the jv-retry-checkout branch November 9, 2025 13:45
@greg-rychlewski
Copy link
Member

@josevalim beautiful :)

I could do the Postgrex side unless you already started/want to?

@josevalim
Copy link
Member Author

@greg-rychlewski please go ahead if you want to! I can probably focus on this again only next wednesday!

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