-
Notifications
You must be signed in to change notification settings - Fork 5
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
Verify GRPC channel connectivity state READY
to IDLE
transition
#332
Comments
According to https://groups.google.com/g/grpc-io/c/yq4pmBGaXOQ, this isn't currently supported, so I'll post an issue upstream. |
I've created an upstream issue for this. |
Does that mean there's no IDLE timeout and therefore the connection may stay READY forever if there is no activity on the connection? If so, how does this impact our model of connection failure such as when the underlying TCP socket is destroyed from the server side? |
I'd also like to know how the existing grpc keep alive parameters work. Can they help in this arena as well? Or will they just duplicate the functionality of our Please add these into the issue feature request for clarification. |
@tegefaulkes said that he'd tested this previously, and had seen the connection go from
Added. |
Either it will say READY forever or timeout after 30 min or some other arbitrary timeout. In terms of how we handle our connection logic. It shouldn't make a difference unless our own TTL exceeds the timeout of the GRPC in which we treat it as a normal connection failure. I'm just making an assumption here but I feel the keep alive parameters relate to the TCP keep alive pings? such as the time spacing of the pings, how long the connection waits after a missing keep alive ping before closing the connection. |
I tested to see how long a timeout would take with the assumption that it would be 5 min, I gave up after 6 min after not seeing it return to IDLE. so I don't know how long the timeout is but it's longer than 6 min. |
Ah my bad - I had thought that you'd seen it transition after 6 minutes. This makes more sense in the context of everything. |
So we need a test for the TCP is destroyed on the server side without shutting down the GRPC server. #224 (comment)
In this case, since there's no idle timeout functionality in GRPC, then one of 2 things can happen:
What is the default for GRPC's keepalive timeout? And does it result in the same READY to IDLE transition? If the default exists, we should at least configure it to either be removed, and rely on our node connection timeout, or make it shorter for some other reason. We want to avoid duplicate functionality here as it complicates debugging in the future.
|
If GRPC's keepalive timeout already does what we want for NodeConnection TTL, then we have duplicate functionality here. I would prefer we keep our NodeConnection TTL simply because we have better control over it, and somehow disable the GRPC keepalive. However if GRPC keepalive has some special ability that our NodeConnection TTL doesn't, then we need to work that out. |
My guess is that GRPC's keepalive would keep the GRPC connection alive as long as the underlying socket is still live. Meaning that even if I don't do any calls on it, it will be kept at Then that means our Both of these can work simultaneously, but of course our GRPC keepalive timeout should be much shorter than our Finally the network UTP keepalive is completely independent of both, but should be shorter than the GRPC keepalive timeout. |
@tegefaulkes did you only test the GRPC connections over TCP, or also over the
We need both the GRPC over TCP and GRPC over network UTP to be sure. |
Currently all of the tests are going through the proxies. I don't know if that's testing with TCP or UTP. I don't know the details of that. |
Ok well in that case, it's simple then, if you want to test how the GRPC keepalive works, you can do it with directly over TCP instead. Doing it over TCP will be important for solving #276. |
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
Added a callback to the `Proxy` that is called when a `ForwardConnection` or `ReverseConnection` is established and authenticated. It is called with the following connection information; `remoteNodeId`, `remoteHost`, `remotePort` and `type`. They type signifies if it was a forward or reverse connection. Note that this is only triggered by composed connections. Added a test for if the callback was called when a `ReverseConnection` is established. Relates #332 Relates #344
As we transition to the JSON RPC system, the underlying transport protocol no longer matters relative to the RPC. Instead the Right now, the object would contain both a readable stream and a writable stream. This mean it's possible for there to be separate errors for each. You could have an error for the readable stream, but not for the writable stream and vice-versa. It seems we still need to be able to connect the underlying state changes, by adding an event handler to the stream so that the RPC client abstraction can also be errored out. We have to standardise on how we do this push-based dataflow. 2 ways:
Important that any errors thrown in the event handler gets caught and gets re-emitted as an It's possible to convert from any event emitting object into an observable (specifically a subject observable), this may be more elegant for composition purposes, and there's an issue exploring this in #444. |
This is no longer relevant, as we are moving to using our own transport agnostic RPC. However both the websocket and quic transports have events that correspond to state changes of the transport/stream/connection. For the websocket transport, there will be a close event that occurs on the socket object (this is for the WS library). For the quic transport, there is events corresponding to the connection, and to the stream separately. With respect to the await rpcClient.methods.unary(); So internally it calls the stream factory (the callback could take parameters) to acquire a stream. That stream is then used to do the actual operation. This stream only exists for the lifetime of the call itself. Otherwise the RPC client does manage any additional state. Which means the So what happens when a connection state fails. It would mean that the next time one calls the This is great because our The complexity of connection state transition tracking is now moved to a separate layer of the system. Specifically the actual transport implementations. |
Specification
In #224 and #310 we introduced the ability for our
GRPCClient
to react the state changes in the underlying client's channel state. In particular, we perform athis.destroy()
when the underlying channel is no longer live.One state transition we were not able to test for. This is when the underlying channel state goes from
READY
toIDLE
.According to #310 (comment), this can occur one of 2 ways:
So the issue is that, we want to trigger the GRPC TTL and actually test that this transition actually occurs.
Does this GRPC TTL actually exist? Well according to the C++-docs, it is controlled by this parameter https://grpc.github.io/grpc/core/group__grpc__arg__keys.html#ga51ab062269cd81298f5adb6fd9a45e99, and the default value is 30 minutes. When @tegefaulkes was trying to run it, he couldn't see it after 6 minutes.
Furthermore the transition tables https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md indicate that
READY
becomesIDLE
after the idle timeout passes.In the source code of grpc-js, there is no mention of an idle timeout parameter on the channel options, so it's possible that this hasn't been exposed in grpc-js, or maybe even not implemented.
A question about this has been posted: https://groups.google.com/g/grpc-io/c/yq4pmBGaXOQ
@joshuakarp please also create an issue on grpc-js github requesting it as a feature addition.
Additional context
upstream issue for feature request Set a channel's idle timeout grpc/grpc-node#2046
Propagate networking connection error handling into NodeConnection error handling #224 - Original issue about exposing channel state to our GRPC abstractions and

Tasks
The text was updated successfully, but these errors were encountered: