-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ETIMEDOUT on IDLE #11
Comments
I guess bringing it down to 2 min (or make it configurable) would be an option. I’ll look into it. |
FWIW, I don't actually think it's the timeout being too long that is the problem here; I think actually there's something wrong with the way it's writing Continuing to dig into it. |
Confirmed experimentally that Gmail will allow IDLE for at least 25 mins when directly connected, so that's not the issue. |
In
Still investigating. |
Maybe it's compression related? You can disable compression by returning |
Yeah, the It's unclear to me why changing the socket timeout fixes this, but it does cause |
windowBits size is defined by RFC4978:
|
Just to be clear, when I say "suspicious", I mean "this sounds like it could be causing an unfilled buffer" :) |
Yeah, the compression thing was more or less hacked together into a state that “works”, so everything about it is kind of suspicious. |
Could this be your local connection issue? Eg. home router killing long TCP connections etc? Or does this happen also on a server? |
Even weirder: it looks like I fairly consistently get TCP retransmissions when sending that DONE: This seems to indicate network congestion of some sort, except that it consistently happens every time, and only for the I... am genuinely stumped as to what's happening here. |
Through further testing, it does indeed appear to be ISP-related rather than a generic Gmail problem, although it appears it's caused by the use of It seems this may be the same issue as nodejs/node#24689. Increasing the timeout to 5s (the default Thunderbird value for TCP keep-alive) appears to fix this. Phew. So, changing the above to |
Oh wow, great work, thanks a lot! I didn’t even know about the time argument for setKeepAlive or that there would be a difference. |
I added the time argument to setKeepAlive and did a release (v1.0.35), which should fix this then |
Thanks! More than anything, just glad I finally found the cause of the bug :) |
When the client is IDLEing, I get ETIMEDOUT errors:
The log shows a bit more detail (plus timings):
(Using a custom logger with debug for the timings;
imap:server
=S:
,imap:client
=C:
)This appears to be linked to the socket timeout in some non-obvious way; decreasing to 2 minutes instead of 5 makes the IDLE -> NOOP -> IDLE loop work properly. It seems like when it writes the
DONE
, it's timing out waiting for the tagged response. This could be a Gmail-specific thing perhaps.Still digging into what's happening here.
The text was updated successfully, but these errors were encountered: