question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set `TCP_USER_TIMEOUT` by default.

See original GitHub issue

Read https://github.com/grpc/proposal/blob/master/A18-tcp-user-timeout.md for the background. We could do the same for all TCP/IP sockets we use. We could:

  • Add the default value of TCP_USER_TIMEOUT option to Flags
  • Set it in the constructors of ClientFactoryBuilder and ServerBuilder.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
trustincommented, May 27, 2021

Thanks for the detailed idea. That is very useful!

Won’t think about server-side for this iteration since TCP_USER_TIMEOUT (and other timeout related options) only apply to client-side.

I thought TCP_USER_TIMEOUT is applicable to server-side as well? Can’t you set it by using ServerBootstrap.childOption()?

if idleTimeoutMillis > 0 or maxConnectionAgeMillis > 0:
    TCP_USER_TIMEOUT = max(idleTimeoutMillis, maxConnectionAgeMillis)
  if pingIntervalMillis > 0:
    SO_KEEPALIVE = 1
    TCP_KEEPIDLE = pingIntervalMillis
    TCP_KEEPINTVL = pingIntervalMillis # setting TCP_KEEPCNT may not be too important - TCP_USER_TIMEOUT will dominate if enabled anyways.
  • maxConnectionAgeMillis is often a very large value. Shouldn’t it just be TCP_USER_TIMEOUT = idleTimeoutMillis?
  • KEEPALIVE settings sounds reasonable.
2reactions
jrhee17commented, May 12, 2021

Some useful links for personal reference

Read more comments on GitHub >

github_iconTop Results From Across the Web

Which is the default TCP connect timeout in Windows?
TcpInitialRTT : Defines what the initial time-out settings are for new connections. This number in seconds is doubled each time it retransmits ...
Read more >
RFC 5482: TCP User Timeout Option
Abstract The TCP user timeout controls how long transmitted data may remain ... setting ADV_UTO; otherwise, UTO is set to the default USER...
Read more >
Understanding Idle Timeout and Keep Alive Interval settings in ...
The two settings are independent. The default Keep Alive Interval (1800 seconds) is greater than the default Idle Timeout (300 seconds) on a...
Read more >
TCP User Timeout Option draft-ietf-tcpm-tcp-uto-08
Many TCP implementations default to USER TIMEOUT values of a few minutes. Although the UTO option allows suggestion of short timeouts, ...
Read more >
What Is Default Tcp Session Timeout? - Quora
225 default timeout is 1 hour (1:0:0). To close a connection immediately after all calls are cleared, a value of 1 second (0:0:1)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found