-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Retry on "server closed connection unexpectedly" errors #259
Conversation
Codecov Report
@@ Coverage Diff @@
## master #259 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 25 25
Lines 1228 1448 +220
Branches 140 186 +46
==========================================
+ Hits 1228 1448 +220
Continue to review full report at Codecov.
|
b0c1b96
to
e360db4
Compare
Now with tests. |
What does it do with a Psycopg2 sync connector ? |
You're right here to. We need to make the same sort of changes to the Psycopg2 connector. |
44073c4
to
888a4af
Compare
f018d3a
to
161c857
Compare
@ewjoachim I think I took all your comments into account. But happy to have more comments if you have any :) |
nonlocal cnt | ||
if cnt < 2: | ||
cnt += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more natural way to do this is to declare a list outside the function, and append things inside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
5f5c999
to
5d970b3
Compare
procrastinate/psycopg2_connector.py
Outdated
connection.rollback() | ||
raise | ||
else: | ||
connection.commit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we put the putconn
here, then we don't need the outer try
anymore, no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, and I also need to call putconn
after rollback.
Changed.
We're getting there \o/ Thanks for your continued efforts. |
Based on @ewjoachim's feedback.
I am done updating the PR. Ready for final review. |
Closes #255.
Successful PR Checklist: