gatewayd
gatewayd copied to clipboard
Fix bug in handling connection timeouts
When receiveDeadline and sendDeadline are set, the server connections will become stale, while the client connection is still working. There should be a way to recover the connection without breaking the authenticated connections.
Now that both the incoming connection from clients and outgoing connections to the database use net.Conn, it would be beneficial in the long run to have a common structure to manage all these connections. It could be as simple as reusing the Client object and wrapping incoming client connections with it, so that we can set deadlines on both connections at the same time via the same interface. To handle TLS handshake and termination, I did something similar using this ConnWrapper object. It could also be used for this purpose as well, instead of Client.
Refer to docs for more information about the connection lifecycle.
I would like to work on this
@smnmna99
Perfect! I'll add you to this ticket after the invite.