You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Postgres traditional pgjdbc Java client cannot support equivalent options, because it uses traditional Java sockets which do not support the relevant OS socket options. Thus pgjdbc only has a binary TCP keepalive on/off switch, but TCP keepalive without tcp_user_timeout is not reliable, as explained by:
Netty on the other hand has all the relevant support in EpollSocketChannelConfig methods:
setTcpKeepIdle
setTcpKeepIntvl
setTcpKeepCnt
setTcpUserTimeout
pgjdbc-ng could expose configuration options similar to those offered by libpq, that would in effect change the EpollSocketChannelConfig for PG connections (and then it needs to handle the socket timeout correctly, maybe it already does?).
The text was updated successfully, but these errors were encountered:
Postgres C client libpq supports several options for setting up TCP keepalive:
keepalives_idle
keepalives_interval
keepalives_count
tcp_user_timeout
https://www.postgresql.org/docs/13/libpq-connect.html
Postgres traditional pgjdbc Java client cannot support equivalent options, because it uses traditional Java sockets which do not support the relevant OS socket options. Thus pgjdbc only has a binary TCP keepalive on/off switch, but TCP keepalive without tcp_user_timeout is not reliable, as explained by:
https://blog.cloudflare.com/when-tcp-sockets-refuse-to-die/
https://codearcana.com/posts/2015/08/28/tcp-keepalive-is-a-lie.html
Netty on the other hand has all the relevant support in EpollSocketChannelConfig methods:
setTcpKeepIdle
setTcpKeepIntvl
setTcpKeepCnt
setTcpUserTimeout
pgjdbc-ng could expose configuration options similar to those offered by libpq, that would in effect change the EpollSocketChannelConfig for PG connections (and then it needs to handle the socket timeout correctly, maybe it already does?).
The text was updated successfully, but these errors were encountered: