Open xuehaonan27 opened 1 month ago
Should I re-export TcpKeepalive
in socket2
or give a definition on our own?
After some thought, I'm not entirely sure how much value this actually has.
As I worked out in https://github.com/estuary/flow/issues/1676#issuecomment-2392077544, keepalive likely won't solve the original reporter's problem.
It could be useful for other reasons, such as keeping connections from timing out, or catching when a server disconnected abruptly without sending a FIN packet.
However, because the connection state is managed directly, we won't see a keepalive timeout until the next time we try to read from or write to the socket, at which point we're already trying to use it anyway.
I suppose that's still preferable to it hanging forever on a read that will never complete, though.
BREAK CHANGE: [
sqlx_core::net::socket::connect_tcp
]. New parameter added.Add TCP keepalive configuration which could be enabled by [
PgConnectOptions::tcp_keep_alive
] and [MySqlConnectOptions::tcp_keep_alive
].Does your PR solve an issue?
fixes #3540