Skip to content

The connection is unstable when the client is put back in the pool #31

@mostafa

Description

@mostafa

This happens possibly because the client (aka. Frontend) sends a close request. This further causes the server to close the connection, which is why io.EOF is returned as error when disconnecting. That's also why the Proxy.Reconnect is called to re-initiate the connection before putting it back in the pool.

// TODO: The connection is unstable when I put the client back in the pool

gatewayd/network/proxy.go

Lines 196 to 207 in da83204

func (pr *ProxyImpl) Reconnect(cl *Client) *Client {
// Close the client
if cl != nil && cl.ID != "" {
cl.Close()
}
return NewClient(
pr.ClientConfig.Network,
pr.ClientConfig.Address,
pr.ClientConfig.ReceiveBufferSize,
pr.logger,
)
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

🎉 Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions