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
Implementors MAY include "keep-alives" in their TCP
implementations, although this practice is not universally
accepted. If keep-alives are included, the application MUST
be able to turn them on or off for each TCP connection, and
they MUST default to off.
Currently, Deno.listen and Deno.connect occasionally seem to become stale when kept open for a while without any packets (a waiting connection). It doesn't close the connection, and doesn't error out, just becomes unresponsive on both sides until you try to write a packet. This causes me to be unable to free up resources from zombie connections.
As far as I understand, this is due to not sending keep-alive probes. Node has the socket.setKeepAlive API that I'm missing on Deno.
Implementing this might simply be setting the SO_KEEPALIVE, TCP_KEEPIDLE, TCP_KEEPCNT, TCP_KEEPINTVL options on the socket LinuxWindows.
A possible Deno API may look like conn.setKeepAlive(interval)
From RFC1122 4.2.3.6,
Currently,
Deno.listen
andDeno.connect
occasionally seem to become stale when kept open for a while without any packets (a waiting connection). It doesn't close the connection, and doesn't error out, just becomes unresponsive on both sides until you try to write a packet. This causes me to be unable to free up resources from zombie connections.As far as I understand, this is due to not sending keep-alive probes. Node has the
socket.setKeepAlive
API that I'm missing on Deno.Implementing this might simply be setting the
SO_KEEPALIVE
,TCP_KEEPIDLE
,TCP_KEEPCNT
,TCP_KEEPINTVL
options on the socketLinux
Windows
.A possible Deno API may look like
conn.setKeepAlive(interval)
Further reading:
I found this article that seems to describe the exact behaviour I'm facing, and the solution (keep-alive): https://holmeshe.me/network-essentials-setsockopt-SO_KEEPALIVE/#To-detect-an-absent-peer
The text was updated successfully, but these errors were encountered: