From 6b1ebb87c1d96ddc9c998ed30344610c4558cc24 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 22 Apr 2022 13:15:34 +0000 Subject: sidechannel: lower yamux close timeout Lower the yamux StreamCloseTimeout setting from 5 minutes to 1 second for sidechannel connections. The motivation for changing this is to make it easier to test client side cancelation in Workhorse tests. --- internal/sidechannel/sidechannel.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/sidechannel/sidechannel.go b/internal/sidechannel/sidechannel.go index 5cffe9efc..a8e7088d5 100644 --- a/internal/sidechannel/sidechannel.go +++ b/internal/sidechannel/sidechannel.go @@ -151,6 +151,12 @@ func NewClientHandshaker(logger *logrus.Entry, registry *Registry) client.Handsh // waste we change this value back to 256KB which is the default and // minimum value. cfg.MaxStreamWindowSize = 256 * 1024 + + // If a client hangs up while the server is writing data to it then the + // server will block for 5 minutes by default before erroring out. This + // makes testing difficult and there is no reason to have such a long + // timeout in the case of sidechannels. A 1 second timeout is also OK. + cfg.StreamCloseTimeout = time.Second }, ) } -- cgit v1.2.3