You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The graphql-ws protocol supports sending a Ping message. This is useful for detecting failed connections, displaying latency metrics or other types of network probing.
If I have opened a passthrough mode subscription to my subgraph the connection is all good. But we're facing issues with longer intervals between messages. Apollo Router logs a TCP connection reset when no messages have been sent beyond our load balancer after a connection idle timeout.
By capturing traffic, we confirmed neither Apollo Router nor the subgraph actively sends pings/heartbeats on the WebSocket session. Both can respond to heartbeats, but both services are just sitting passive and our LB eventually closes the idle connection.
Describe the solution you'd like
Add an option to enable sending a Ping message to a subgraph from Router on a set interval. Having this off by default is ok, but we need an option to turn it on for our subgraphs
subscription:
enabled: truemode:
passthrough:
all:
path: /subscriptionsprotocol: graphql_wsping_interval: 300# Some option probably in seconds is fine
Describe alternatives you've considered
To keep the connection open we can go and update our subgraph code to also send Ping message because this is bi-directional but we may have to do that across many subgraphs and unfortunately some libraries like DGS don't have support to configure a ping interval either
The implementation of ping message should be implemented in that file and maybe especially there, where you could create an interval stream or so to directly send ping message every X seconds configured. I think it would be enough. But yes we should try to keep the original behavior and set a new option to send ping messages
Is your feature request related to a problem? Please describe.
The graphql-ws protocol supports sending a
Ping
message. This is useful for detecting failed connections, displaying latency metrics or other types of network probing.If I have opened a passthrough mode subscription to my subgraph the connection is all good. But we're facing issues with longer intervals between messages. Apollo Router logs a TCP connection reset when no messages have been sent beyond our load balancer after a connection idle timeout.
By capturing traffic, we confirmed neither Apollo Router nor the subgraph actively sends pings/heartbeats on the WebSocket session. Both can respond to heartbeats, but both services are just sitting passive and our LB eventually closes the idle connection.
Describe the solution you'd like
Add an option to enable sending a
Ping
message to a subgraph from Router on a set interval. Having this off by default is ok, but we need an option to turn it on for our subgraphsDescribe alternatives you've considered
To keep the connection open we can go and update our subgraph code to also send
Ping
message because this is bi-directional but we may have to do that across many subgraphs and unfortunately some libraries like DGS don't have support to configure a ping interval eitherAdditional context
This is not a concern if we use the HTTP callback protocol instead
The text was updated successfully, but these errors were encountered: