use redis-py url syntax for redis_url#2267
Conversation
masenf
left a comment
There was a problem hiding this comment.
Not sure why the redis integration tests are partly failing now, will need to investigate... but the code looks good. Thanks for your contribution!
|
You are welcome. I am not sure, but it looked like a temporary failure to me. I tested this MR locally with multiple redis configurations without any problems. |
|
I wonder if there's something to do with that db=0 parameter in the old code, not sure what that does. |
|
The benchmark test fails with a postgresql error and the integration test with async event loop error. I do not think they are related to the changes in this PR |
|
The benchmark test failure is because your fork doesn't have access to our db secrets, so i'm not too worried about that. The redis integration test failure is my main concern at this point. It seems to repro fairly consistently in CI with this patch, but I'm just not seeing what in the diff would be causing that. RuntimeError: Task <Task pending name='Task-4327' coro=<test_on_load_navigate_non_dynamic() running at /home/runner/work/reflex/reflex/integration/test_dynamic_routes.py:276> cb=[_run_until_complete_cb() at /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/asyncio/base_events.py:180]> got Future <Future pending> attached to a different loopIs the redis client creating its own event loop now? |
|
i did some more testing on this PR and the difference appears to be the I haven't actually traced out a possible fix yet, but i believe this is the source of the discrepancy. |
The close helper method always calls `close_connection_pool=True` so that all outstanding redis operations can be stopped before changing event loops.
|
|
|
Thanks @masenf i did not find time to dig further into this. I was not expecting that using Anyway, your commit seems to mitigate this nicely, thanks! |
Closes #2253