Skip to content

Gracefully handle postgres pool timeouts #759

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

Merged
merged 4 commits into from
May 20, 2020
Merged

Conversation

Kixiron
Copy link
Member

@Kixiron Kixiron commented May 16, 2020

Closes #626

  • Changes from unwrapping on a failure to get a pool to returning an error
  • Adds the docsrs_failed_db_connections metric to monitor timed out database connections
    • A metric for concurrent database connections could also be added

@jyn514
Copy link
Member

jyn514 commented May 16, 2020

How did you test these changes?

@Kixiron
Copy link
Member Author

Kixiron commented May 16, 2020

Testing was done via Apache's ab, if the server's stressed under enough concurrent load then errors start popping up.

Does bring up the issue that the scoping of connections needs improvement, but that's another PR

@pietroalbini
Copy link
Member

A metric for concurrent database connections could also be added

This would be really useful to determine how close we usually are to capacity btw!

@Kixiron Kixiron requested a review from pietroalbini May 18, 2020 14:03
@pietroalbini
Copy link
Member

Do you plan to add the pool capacity metric in this PR or in a followup?

@Kixiron
Copy link
Member Author

Kixiron commented May 20, 2020

Sorry, I've just been a bit busy

@pietroalbini pietroalbini merged commit 28f8bf0 into rust-lang:master May 20, 2020
@pietroalbini
Copy link
Member

Thanks ❤️

@Kixiron Kixiron deleted the r2u2 branch May 20, 2020 15:37
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.

Panic/timeout connecting to postgres
3 participants