jacobchia
04/03/2025, 5:39 AMdata max age
, which seems to be based on max connection time (30s by default and i havent configured this at all). This means that if it we recently tried to connect and it was then closed, then we have to wait up to 30 seconds to re-try. Which matches the latency spikes, but doesn't explain why a connection might be closed by the server before 30 seconds is up
https://cdn.discordapp.com/attachments/844600078948630559/1357228089624625182/image.png?ex=67ef70a8&is=67ee1f28&hm=9feb1b11aa888acab94846c05fa31f9c6002b89d4f58cf244d3353c2871e20f9&
https://cdn.discordapp.com/attachments/844600078948630559/1357228089897390121/image.png?ex=67ef70a8&is=67ee1f28&hm=d0c62906329c5ca80e0181747eafc8b6c565cd2e221c419a092b8814a1282766&yetitwo
04/03/2025, 2:13 PMjacobchia
04/03/2025, 4:17 PMyetitwo
04/03/2025, 4:47 PMyetitwo
04/03/2025, 4:47 PMyetitwo
04/03/2025, 4:53 PMyetitwo
04/03/2025, 4:53 PMyetitwo
04/03/2025, 4:53 PMyetitwo
04/03/2025, 4:53 PMyetitwo
04/03/2025, 4:53 PMyetitwo
04/03/2025, 4:54 PMyetitwo
04/03/2025, 4:54 PMvroldanbet
04/03/2025, 5:10 PMjacobchia
04/03/2025, 5:46 PMyetitwo
04/03/2025, 5:47 PMjacobchia
04/03/2025, 5:48 PMyetitwo
04/03/2025, 5:48 PMkuberesolver
but that was compatible with grpc-node
, they could use it to keep track of the list of available nodes in the client applicationyetitwo
04/03/2025, 5:48 PMjacobchia
04/03/2025, 5:51 PMjacobchia
04/03/2025, 5:52 PMjacobchia
04/03/2025, 5:56 PMyetitwo
04/03/2025, 6:36 PMyetitwo
04/03/2025, 6:37 PMyetitwo
04/03/2025, 6:37 PM--grpc-max-conn-age duration how long a connection serving gRPC should be able to live (default 30s)
jacobchia
04/03/2025, 9:24 PMvroldanbet
04/04/2025, 7:54 AMvroldanbet
04/04/2025, 7:54 AMMaxConnectionAge
[by default to 30 seconds](https://github.com/authzed/spicedb/blob/e5323c57d11652c147bb069a25cefe58a20bcaac/pkg/cmd/util/util.go#L72). That's what data max age
means. This is what the grpc-go docs say:
> // MaxConnectionAge is a duration for the maximum amount of time a
> // connection may exist before it will be closed by sending a GoAway. A
> // random jitter of +/-10% will be added to MaxConnectionAge to spread out
> // connection storms.
It means that gRPC connections in the server don't live for longer than 30 seconds. When they reach 30 seconds plus some jitter, the server will send GOAWAY
.
Now, that does not necessarily explain why your client is waiting 30 seconds. This is what the connectivity semantics say:
> IDLE: This is the state where the channel is not even trying to create a connection because of a lack of new or pending RPCs. New RPCs MAY be created in this state. Any attempt to start an RPC on the channel will push the channel out of this state to connecting. When there has been no RPC activity on a channel for a specified IDLE_TIMEOUT, i.e., no new or pending (active) RPCs for this period, channels that are READY or CONNECTING switch to IDLE. Additionally, channels that receive a GOAWAY when there are no active or pending RPCs should also switch to IDLE to avoid connection overload at servers that are attempting to shed connections. We will use a default IDLE_TIMEOUT of 300 seconds (5 minutes).vroldanbet
04/04/2025, 7:55 AMvroldanbet
04/04/2025, 7:58 AMCONNECTING
state. This is also where the resolver kicks in. The resolver responsibility is:
> receiving updated configuration and list of server addresses from the resolvervroldanbet
04/04/2025, 8:01 AMvroldanbet
04/04/2025, 8:08 AMcall_stream
- Traces client request internals
> - channel
- Traces channel events
> - connectivity_state
- Traces channel connectivity state changes
> - dns_resolver
- Traces DNS resolution
> - ip_resolver
- Traces IPv4/v6 resolution
> - pick_first
- Traces the pick first load balancing policy
> - proxy
- Traces proxy operations
> - resolving_load_balancer
- Traces the resolving load balancer
> - round_robin
- Traces the round robin load balancing policy
> - server
- Traces high-level server events
> - server_call
- Traces server handling of individual requests
> - subchannel
- Traces subchannel connectivity state and errors
> - subchannel_refcount
- Traces subchannel refcount changes. Includes per-call logs.
> - subchannel_flowctrl
- Traces HTTP/2 flow control. Includes per-call logs.
> - subchannel_internals
- Traces HTTP/2 session state. Includes per-call logs.
> - channel_stacktrace
- Traces channel construction events with stack traces.
> - keepalive
- Traces gRPC keepalive pings
> - outlier_detection
- Traces outlier detection eventsvroldanbet
04/04/2025, 8:21 AMyetitwo
04/04/2025, 8:24 PMyetitwo
04/04/2025, 8:24 PMjacobchia
04/04/2025, 9:43 PMjacobchia
04/04/2025, 9:44 PM