4 hours ago · Tech · hide · 0 comments

After the system goes into sleep and wakes up again, ImapGoose would just hang for like 15–20 minutes before finally detecting the disconnection and reconnect. This was super annoying, and understanding the root cause was not trivial at all. ImapGoose sends a NOOP to the server every three minutes. This NOOP is basically like a ping to which the server must reply. The timeout it set to thirty seconds, so why did it take around 20 minutes to detect the disconnection? Part 1[permalink] While the system is asleep, the server sends a RST indicating that the connection is terminated. This message is never delivered because our host is no longer on the network. The system wakes up again and has no impression that the connection is dead. The Linux kernel puts the NOOP message send by ImapGoose in its internal outbound buffer. While there’s data pending to be written in the outbound buffer, the underlying TCP keepalive is paused. Sending this message fails on a dead connection, so Linux keeps…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.