-
Notifications
You must be signed in to change notification settings - Fork 197
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
Made core layer close connection pools on loop close. #347
Conversation
Following some test failures while upgrading a project, mostly failing with;
I now have a passing test suite with these changes. Thank you @sevdog |
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.
OK, let's have it. (Lint, I see...)
@sevdog I've been somewhat occupied. If you fancied reviewing the open issues and PRs for any others that you think are ready to go, or close, that would really help, and I'll see if I can get a release out. Thanks |
(There's the one about the settings dict at least IIRC) |
Actually there are two: #341 (to avoid host dict changes in base layer) and #337 (to pass extra params). Maybe it could be nice to have the first merged since it could cover also the latter (but it needs to be changed since it is partial). PS: it is fun that people focuses on a single layer implementation forgetting that there is an other one 😅 |
Is it normal that unittests runs for such a long time? I got some problems also locally and only worked with an old version of python redis (4.3.5), with any more recent version there was something which kept hanging forever. |
No, that means something is amiss. It was happening a while back back had cleared up, so I guess what changed? |
There is something which gives problems in one of these tests (which are the last two logged before timeout):
Also my host keeps hanging with them if I test with tox (which creates its own env). the stacktrace of cancelation shows that it was waiting to receive something (I stopped tox during
From actions history it seems that something messed up execution (also the changelog PR #333 took about 6 hours) https://github.com/django/channels_redis/actions |
Ok, I reran the workflow, it hung again. Something needs rewriting. I'll have to a look (but that might be a little while...) |
In these latest runs I am thinking some of the pains around the 4.0.0 release with regard to flaky tests was having set https://github.com/bbrowning918/channels_redis/actions is me messing about with versions |
@carltongibson I tried to run tests with
PS: there is also a typerror in
|
@bbrowning918 -- If a temporary pin solved the issues, I'm happy to take that but ideally we'd work out what's going on... (I feel slightly bad saying that since I have 0 capacity myself just now 😬) |
@sevdog — So if you skip those tests? 🤔 (It's not a solution, but it narrows down our issue....) |
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.
Hey @sevdog — I rebased after #349 — all green.
Can I get you to add a regression test for this? The issue was calling async_to_sync()
on the channel layer twice in the same context, so doing that? See #332 and django/channels#1966 (comment)
Ok, as soon as I got a spare moment I will add a test which assure that no runtime error related to loop is raised. |
Thanks @sevdog — if we can get this one in then we're not far off being able to roll a 4.1. Thanks for your help! 🎁 |
I used a bad yet effective copy of I choose to "copy" that test since it was close to the current solution proposed to solve the issue, thus I just had to remove the |
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.
Small refactor to assure that both
RedisChannelLayer
andRedisPubSubChannelLayer
closes connections upon event-loop close.This will prevent redis from raising
RuntimeError
(see #332).Closes #332.