Repository navigation
Reconnect disconnected channels automatically - #11154
Conversation
nathanielmanistaatgoogle
left a comment
There was a problem hiding this comment.
Just to double-check, because I think it might be slightly amazing: you've confirmed that the test fails in the absence of the non-test portion of this change?
There was a problem hiding this comment.
This should be a TODO (possibly a TODO(https://github.com/grpc/grpc/issues/11043)?).
There was a problem hiding this comment.
I don't think this change is sufficient to close #11043 because #11043 is a wrapped-languages issue and this is a Python-only change.
#9884 might be the right issue for scoping the temporary-ness of this workaround; I think I'm a little thrown by the way it's being called "retries" and being described as a feature when I keep encountering it as "not trying hard enough the first time" and thinking of it as a bug.
There was a problem hiding this comment.
How certain are you that this is necessary? What does this do that the _moot call on the next line doesn't also do? If we can eliminate this call, we can also eliminate the maintenance of the dummy callback as an instance field, right?
There was a problem hiding this comment.
Just for test sanity's sake let's make the value of this constant different from the value of _REQUEST.
There was a problem hiding this comment.
Always leave the unnecessary ess off the end of assertEqual.
There was a problem hiding this comment.
"Rebalance" the statements in this test so that nothing in the test method "undoes" what was done in setUp and also so that nothing in the test method "does" what will later be undone in tearDown. (I think this will mean that what will be left in your test will be only instantiating the thread pool, at which point you may choose to simply not bother with having a separate setUp/tearDown.)
A unit test with a setUp/tearDown and also only a single test method is particularly susceptible to premature generalization.
There was a problem hiding this comment.
Removed setUp/tearDown
There was a problem hiding this comment.
We haven't been good about this in the past but it's on my list of things to clean up (and in the meantime, to avoid digging deeper): use the PEP8-style name test_reconnect.
There was a problem hiding this comment.
Missing leading underscore on this name.
|
When the non-test changes are removed, the test fails: |
1b471b7 to
30d066b
Compare
|
@nathanielmanistaatgoogle Addressed comments, back to you |
There was a problem hiding this comment.
What's the significance of returning None, None rather than just None?
There was a problem hiding this comment.
The second none is the try_to_connect arg, not part of the lambda.
There was a problem hiding this comment.
Typography nitpick: missing colon after closing parenthesis and start the prose of the comment on the same line rather than line-wrapping after the TODO(...):.
Huh. I guess the colon isn't required. Aww phooey; I've always liked it.
There was a problem hiding this comment.
I don't think this change is sufficient to close #11043 because #11043 is a wrapped-languages issue and this is a Python-only change.
#9884 might be the right issue for scoping the temporary-ness of this workaround; I think I'm a little thrown by the way it's being called "retries" and being described as a feature when I keep encountering it as "not trying hard enough the first time" and thinking of it as a bug.
nathanielmanistaatgoogle
left a comment
There was a problem hiding this comment.
I'm a little skittish about spawning a thread per channel, but... okay.
There was a problem hiding this comment.
assertEqual without the trailing ess here too.
42f53b9 to
5bcbc79
Compare
5bcbc79 to
8f7bc54
Compare
Submission pending on #10813
The memory leak described in that poll request is likely the cause of #9461,
and without a fix this will introduce that leak to all channels.