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
Fix "Unable to detect disconnect when using NOTIFY/LISTEN", Closes #249 #559
Conversation
Codecov Report
@@ Coverage Diff @@
## master #559 +/- ##
==========================================
+ Coverage 93.24% 93.36% +0.12%
==========================================
Files 11 11
Lines 1525 1553 +28
Branches 179 182 +3
==========================================
+ Hits 1422 1450 +28
Misses 72 72
Partials 31 31
Continue to review full report at Codecov.
|
What is this checklist item "Add a new news fragment into the CHANGES folder"? There is no CHANGES folder, as far as I can see... |
ignore, I will correct later |
@vir-mir hi! any news on this PR? |
@vir-mir I'm interested in the fix too. Could you review it, please? 😉 |
any news on this PR? I would be interested in the fix too. @gjcarneiro it seems there are a few conflicts, could you please update the branch? |
I've updated the PR for current master. Can we get this merged please? Been 2 years... :/ |
Hi @gjcarneiro, Sorry for the so long delay. I hope I will be able to review it later today or tomorrow. Thanks for rebasing it 👍 |
@gjcarneiro I'm a bit concerned about one aspect of the implementation: it covers only get method of the queue(I suspect not so many people use get_no_wait(for instance), but anyway). What do you think about exposing a kind of proxy object which exposes only async get method(probably we need to expose any other methods/properties)? |
That's a good point. I didn't think about
Well, I tried to make this 100% backwards compatible. What you propose, I don't know if it would be 100% compatible? It would probably be cleaner, but... I'll think about it. |
95f6203
to
cdcc484
Compare
I've updated the PR with making ClosableQueue a proxy class instead of a subclass. |
I've made a new version. Any more comments? |
ping |
Sorry for the delay, quite overloaded at work, hope will be able review it on this week. |
Awesome! Could you please make a release with this fix? |
Hi @albertodonato, Surething, but it will be the beta version(probably |
What do these changes do?
When connection to DB is closed, any tasks pending on
await connection.notifies.get()
receives an exception, instead of hanging forever.Are there changes in behavior for the user?
Now
connection.notifies.get()
can raise a psycopg2 exception, whereas before this would hang forever.Related issue number
#249
Checklist
CONTRIBUTORS.txt
<Name> <Surname>
.CHANGES
folder<issue_id>.<type>
(e.g.588.bugfix
)issue_id
change it to the pr id after creating the PR.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.Fix issue with non-ascii contents in doctest text files.