Skip to content

Fix stale connections to Praefect due to keepalive policy

Patrick Steinhardt requested to merge pks-praefect-keepalive-policy into master

While the Gitaly server sets up a keepalive enforcement policy, the Praefect server doesn't. As a result, the default policy is active which says that a keepalive ping is only allowed ever 5 minutes and only if there is an active stream.

This may in fact explain some latency issues we've been seeing with the transaction service. Given the current infrequent accesses to it, there are extended periods of time where no calls are being made from Gitaly to Praefect. But while Gitaly clients have keepalive set up to ping Praefect every 20 seconds even if there are no streams, Praefect will just discard these pings. As a result we may see stale connections which will time out only to reconnect afterwards.

Let's specify the same keepalive enforcement policy for Praefect as we do for Gitaly to fix this issue.

Merge request reports