On Thu, Jun 30, 2016 at 12:02 PM, <[email protected]> wrote:

> Thanks. One followup question.
>
> If a balancer has requested that a connection be closed (by removing it
> from the slices sent over the Notify() channel), but it hasn't yet closed
> (because something is still using it), so the "down" func has not yet been
> called yet, and then the balancer adds it back to the list of desired
> connections (by adding it to the slice again), will Up() be called again
> for that connection?
>
down will be called once the receiver of Notify() channel reads it (
https://github.com/grpc/grpc-go/blob/master/clientconn.go#L359) regardless
whether there are pending rpcs on it or not (note that down() has to be
called to prevent the later rpcs from choosing that connection).

Even if the balancer gets the address back before the receiver of Notify()
reads the updates, there is no issue because the reads from the Notify()
channel are serialized -- the connection will be tore down first then
re-established.

>
> Zellyn
>
> On Thursday, June 30, 2016 at 2:33:29 PM UTC-4, Qi Zhao wrote:
>>
>> correct. But the new rpcs won't take that connection any more.
>>
>> On Thu, Jun 30, 2016 at 11:30 AM, <[email protected]> wrote:
>>
>>> Just curious: when using a custom balancer with Go grpc, I'm assuming a
>>> connection will remain open as long as a streaming RPC on it is open, even
>>> if the balancer removes it from the list of addresses it returns?
>>>
>>> Zellyn
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "grpc.io" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/grpc-io/f361dfeb-a639-4858-8c8f-984f43833b2a%40googlegroups.com
>>> <https://groups.google.com/d/msgid/grpc-io/f361dfeb-a639-4858-8c8f-984f43833b2a%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Thanks,
>> -Qi
>>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/grpc-io/93a0ccb6-2fd6-4962-987f-b96b1e0f3a7b%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/93a0ccb6-2fd6-4962-987f-b96b1e0f3a7b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks,
-Qi

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAFnDmdqOYZKKHh%2BJ%3DwYPFG5yQqxPQ_r-wR4%2BmBS%2BBDUpwVnSSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to