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

Add error handling and retry to session_scope() #816

Open
nesnoj opened this issue Jun 22, 2022 · 1 comment
Open

Add error handling and retry to session_scope() #816

nesnoj opened this issue Jun 22, 2022 · 1 comment
Assignees
Labels
🚀 feature New feature or feature request

Comments

@nesnoj
Copy link
Member

nesnoj commented Jun 22, 2022

In 157e29a a temporary error handling was built into check_db_unique_violation() now covering UniqueViolation (IntegrityError), DeadlockDetected (OperationalError) with a retry functionality.

The "Too many clients already" #799 is not covered yet but could be. Alternatively, we could increase max_connections().

check_db_unique_violation() was not meant to handle DB errors in general, this could be generalized and moved to an appropriate place such as session_scope().

However, this would not cover

  • queries that run outside the session scope (e.g. some SQL scripts),
  • tasks that use sessionmaker instead of session scope (@ClaraBuettner knows about some..)

Having this background, does it make sense to you @gnn to integrate it into the session scope?

@nesnoj nesnoj added the 🚀 feature New feature or feature request label Jun 22, 2022
@nesnoj nesnoj self-assigned this Jun 22, 2022
@nesnoj nesnoj removed their assignment Jun 30, 2022
@nesnoj
Copy link
Member Author

nesnoj commented Jun 30, 2022

@gnn As agreed yesterday, the floor is all yours! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feature New feature or feature request
Projects
None yet
Development

No branches or pull requests

2 participants