TCP sockets are not properly closed and stay in state CLOSE_WAIT
I'm using GOA to connect to a Nextcloud instance. Over time, goa-daemon leaves a lot of sockets in state CLOSE_WAIT
instead of properly closing them. I can reproduce this with version 3.49.2 on Arch Linux as follows:
-
Start with a fresh instance of goa-daemon, e.g. by restarting it (
systemctl --user restart 'dbus-:1.2-org.gnome.OnlineAccounts@0.service'
). -
List the open sockets via
sudo lsof -i -a -p $(pidof goa-daemon)
. For me, the output looks as follows:COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME goa-daemo 699195 bevan 14u IPv6 22487589 0t0 TCP myhostname:60832->cloud.example.org:https (ESTABLISHED)
-
Interrupt the network connection for a moment. Then restore it again.
-
List the open sockets again. For me this now shows:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME goa-daemo 699195 bevan 14u IPv6 22487589 0t0 TCP [my:former:ipv6:address]:50080->cloud.example.org:https (ESTABLISHED) goa-daemo 699195 bevan 16u IPv4 22480611 0t0 TCP myhostname:49250->cloud.example.org:https (ESTABLISHED) goa-daemo 699195 bevan 18u IPv4 22490243 0t0 TCP myhostname:49256->cloud.example.org:https (ESTABLISHED) goa-daemo 699195 bevan 20u IPv6 22491367 0t0 TCP myhostname:41886->cloud.example.org:https (ESTABLISHED) goa-daemo 699195 bevan 22u IPv6 22491380 0t0 TCP myhostname:41888->cloud.example.org:https (ESTABLISHED) goa-daemo 699195 bevan 24u IPv4 22491381 0t0 TCP myhostname:45434->cloud.example.org:https (ESTABLISHED) goa-daemo 699195 bevan 26u IPv4 22494349 0t0 TCP myhostname:45438->cloud.example.org:https (ESTABLISHED)
-
After a while, all of the new connections go into state
CLOSE_WAIT
and stay in that state forever:COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME goa-daemo 699195 bevan 14u IPv6 22487589 0t0 TCP [my:former:ipv6:address]:50080->cloud.example.org:https (ESTABLISHED) goa-daemo 699195 bevan 16u IPv4 22480611 0t0 TCP myhostname:49250->cloud.example.org:https (CLOSE_WAIT) goa-daemo 699195 bevan 18u IPv4 22490243 0t0 TCP myhostname:49256->cloud.example.org:https (CLOSE_WAIT) goa-daemo 699195 bevan 20u IPv6 22491367 0t0 TCP myhostname:41886->cloud.example.org:https (CLOSE_WAIT) goa-daemo 699195 bevan 22u IPv6 22491380 0t0 TCP myhostname:41888->cloud.example.org:https (CLOSE_WAIT) goa-daemo 699195 bevan 24u IPv4 22491381 0t0 TCP myhostname:45434->cloud.example.org:https (CLOSE_WAIT) goa-daemo 699195 bevan 26u IPv4 22494349 0t0 TCP myhostname:45438->cloud.example.org:https (CLOSE_WAIT)
While I can reproduce this manually by disconnecting/reconnecting to my network, these connections also just accumulate over time while the system is running normally. I'm not sure if it's still triggered by brief network outages in that case or something else.