-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Implement retriable connection #92
Implement retriable connection #92
Conversation
841096a
to
3b6d033
Compare
At the moment, a client will die if the server is killed or the connection is lost. This is a problem especially with clients subscribed to a channel. Resolves: #83 ToDo
The following tests are failing inconsistently, and I would need some help to figure out why:
For example, before running
I would like some help to finish this PR. |
abd0516
to
b70cc5a
Compare
Thanks for working this, @sebastienfilion! |
Umm, it looks like the $ deno test -A --unstable --filter testSubscribe
running 4 tests
test testSubscribe ... FAILED (9ms)
test testSubscribe2 ... ok (6ms)
test testSubscribe3 ... ok (5ms)
test testSubscribe4 (#83) ... ignored (0ms)
failures:
testSubscribe
AssertionError: Test case is leaking async ops.
Before:
- dispatched: 23
- completed: 12
After:
- dispatched: 44
- completed: 44
Make sure to await all promises returned from Deno APIs before
finishing test case.
at Object.assert ($deno$/util.ts:35:11)
at asyncOpSanitizer ($deno$/testing.ts:43:5)
at async Object.resourceSanitizer [as fn] ($deno$/testing.ts:67:5)
at async TestRunner.[Symbol.asyncIterator] ($deno$/testing.ts:275:11)
at async Object.runTests ($deno$/testing.ts:358:20)
failures:
testSubscribe
test result: FAILED. 2 passed; 1 failed; 1 ignored; 0 measured; 177 filtered out |
Part of the problem is If I run I guess that it's because before, the TCP connection was garbage collected with the writers? |
dd3d184
to
e5f918d
Compare
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.
@sebastienfilion
Thank you for submitting the changes!
There are still a few things that need to be fixed.
Please check again.
e5f918d
to
f7e88d5
Compare
Thanks for submitting the changes @sebastienfilion!
We can merge this PR when the above issue is resolved. |
Will you help resolve the issue or you want me to do it? |
Yeah, I'll also investigate the cause. |
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.
Requested changes address the problem of the testSubscribe
case.
(However, the other cases still fail...)
Good catch! |
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.
@sebastienfilion
I commented again. Please fix them!
Then all the tests should pass.
f7e88d5
to
f494171
Compare
@uki00a I made the changes that you suggested and all but one test passes! 🎈 |
At the moment, a client will die if the server is killed or the connection is lost. This is a problem especially with clients subscribed to a channel. Since the Writer/Reader buffers are passed around to I/O functions, it is impossible to reconnect a Redis client. Having a connection object allows to easily replace the buffers. Resolves: denodrivers#83
f494171
to
3bfad8c
Compare
Awesome work! |
Released in v0.11.0! |
Add a test for an issue that was reported where the process exits if the connection to the Redis server is lost while being subscribed to a topic.
To run this test, you will need to specifically allow to run (execute) commands and enable the unstable API --
deno test --allow-net --allow-run --unstable
Reference: #83