Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
net: setKeepAlivePeriod may be wrong on Solaris #9614
In revision f956740 the function setKeepAlivePeriod in the net package was changed on Solaris to use TCP_KEEPIDLE and TCP_KEEPINTVL. However, I am told that on Solaris 11.2, those symbols are not defined. They are defined in our syscall package because they are defined on Illumos, which is derived from OpenSolaris. If we want Go to have support for Solaris proper, not just OpenSolaris, we should probably go back to the earlier Solaris-specific version of setKeepAlivePeriod.
The problem here is that it impossible to perfectly emulate TCP_KEEPINTVL + TCP_KEEPIDLE using TCP_KEEPALIVE_THRESHOLD and TCP_KEEPALIVE_ABORT_THRESHOLD.
Generally speaking, TCP_KEEPALIVE_ABORT_THRESHOLD = TCP_KEEPCNT * TCP_KEEPINTVL, however, when using TCP_KEEPALIVE_ABORT_THRESHOLD, Solaris will not send probes at equal intervals, but will use an exponential backoff algorithm. That is not what we want.
If it's "good enough", and we decide to go with it, we need to find a good value for TCP_KEEPCNT. I don't know what a good value is.
added a commit
May 6, 2015
A future release of Solaris now supports these interfaces in a Linux-compatible way, so perhaps once a path for issue #15227 is figured out, we can figure out a way to use these on Solaris as well if they are available.
As an example, the values on a development version of Solaris are currently:
...while they are this on some OpenSolaris-based derivatives: