edge icon indicating copy to clipboard operation
edge copied to clipboard

Close idle connections gracefully in GMT

Open pwilloughby opened this issue 1 year ago • 4 comments

Background

What is the problem/pain point?

Idle connections are currently being terminated by our load balancer with a hard disconnect. FileZilla PRO doesn't handle the hard disconnect well but works fine if the connection is terminated gracefully.

Status: Resolving address of data.gateway.storjshare.io
Error: GnuTLS error -110 in gnutls_record_recv: The TLS connection was non-properly terminated.
Status: Server did not properly shut down TLS connectionError: Could not read from socket: ECONNABORTED - Connection aborted

There are also some traces available here

Requirements

Close idle connections gracefully. One way to do this would be to have gateway-mt close idle connections before the load balancer does.

Acceptance Criteria

FileZilla Pro no longer gets errors on idle timeout.

pwilloughby avatar Aug 12 '23 01:08 pwilloughby

The idle timeouts on the load balancer were increased here https://github.com/storj/infra/pull/4738 for an unrelated issue.

pwilloughby avatar Aug 28 '23 22:08 pwilloughby

if we make the load balancer have a longer idle timeout than gateway, then would the graceful termination behaviour be enforced, or is there an edge condition I'm not thinking of?

nergdron avatar Oct 03 '23 00:10 nergdron

we did increase the timeouts on haproxy with https://github.com/storj/infra/pull/4738, but then it got reverted due to that authservice client bug where it wouldn't re-use connections, but that's fixed now since v1.61.0. I think we can increase the timeouts again now! @nergdron @pwilloughby

halkyon avatar Oct 03 '23 01:10 halkyon

then would the graceful termination behaviour be enforced,

I'm not sure gateway has an idle timeout currently, that probably needs a code or config change.

pwilloughby avatar Oct 03 '23 19:10 pwilloughby

Change {cmd,pkg}: support setting IdleTimeout mentions this issue.

storj-gerrit[bot] avatar Oct 04 '24 21:10 storj-gerrit[bot]

Change salt/states/haproxy: increase idle timeout mentions this issue.

storj-gerrit[bot] avatar Oct 15 '24 18:10 storj-gerrit[bot]