quinn icon indicating copy to clipboard operation
quinn copied to clipboard

setting idle_timeout to very large numbers yields in immediate timeout

Open est31 opened this issue 6 years ago • 6 comments

When I'm setting idle_timeout to numbers like 1<<62 - 1 or 1 << 61, I'm getting an idle timeout right after connecting. "small" values like 2000 work great.

est31 avatar Jan 22 '19 20:01 est31

In debug mode, instead of an idle timeout right away you are getting an "attempt to multiply with overflow". This is what I'm getting for various values in debug mode:

  • 1 << 20 works
  • 1 << 26 works
  • 1 << 27 - 1 works
  • 1 << 27 doesn't work "timer shutdown"
  • 1 << 40 doesn't work "timer shutdown"
  • 1 << 50 doesn't work "attempt to multiply with overflow"
  • 1 << 60 doesn't work "attempt to multiply with overflow"
  • 1 << 63 doesn't work "value too large"

est31 avatar Jan 22 '19 20:01 est31

#212 should address the overflow; the other cases look like tokio behaving weird, which will need to be investigated separately, although I'm not sure there's a genuine usecase for setting your idle timeout longer than 4 years once #212 also fixes disabling the timeout outright.

Ralith avatar Jan 23 '19 02:01 Ralith

#213 addressed the "value too large" panic by sanity-checking during varint construction, as well.

Ralith avatar Jan 25 '19 19:01 Ralith

So should we close this now?

djc avatar Jan 27 '19 12:01 djc

I haven't investigated the "timer shutdown" issue yet; I suspect it's an issue with tokio

Ralith avatar Jan 27 '19 19:01 Ralith

So should we close this now?

Ideally, I'd like any unexpected limits to be documented before closing.

est31 avatar Jan 27 '19 19:01 est31