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

net: setKeepAlivePeriod may be wrong on Solaris #9614

Open
ianlancetaylor opened this Issue Jan 16, 2015 · 5 comments

Comments

Projects
None yet
6 participants
@ianlancetaylor
Contributor

ianlancetaylor commented Jan 16, 2015

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.

@4ad

This comment has been minimized.

Member

4ad commented Mar 17, 2015

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.

@4ad 4ad assigned mikioh and 4ad and unassigned 4ad and mikioh Mar 17, 2015

@4ad

This comment has been minimized.

Member

4ad commented Mar 17, 2015

Mikio, do you know what a good TCP_KEEPCNT value is?

@mikioh

This comment has been minimized.

Contributor

mikioh commented Mar 22, 2015

Maybe 2^3? Agree that TCP_KEEPALIVE_THRESHOLD is equivalent to TCP_KEEPIDLE, TCP_KEEPALIVE_ABORT_THRESHOLD is equivalent to TCP_KEEPINTVL x TCP_KEEPCNT.

@rsc rsc added OS-Solaris and removed os-solaris labels Apr 10, 2015

@gopherbot

This comment has been minimized.

gopherbot commented Apr 25, 2015

CL https://golang.org/cl/7690 mentions this issue.

4ad added a commit that referenced this issue May 6, 2015

net: try to fix setKeepAlivePeriod on Solaris
Unfortunately Oracle Solaris does not have TCP_KEEPIDLE and
TCP_KEEPINTVL. TCP_KEEPIDLE is equivalent to TCP_KEEPALIVE_THRESHOLD,
but TCP_KEEPINTVL does not have a direct equivalent, so we don't set
TCP_KEEPINTVL any more.

Old Darwin versions also lack TCP_KEEPINTVL, but the code tries to set
it anyway so that it works on newer versions. We can't do that because
Oracle might assign the number illumos uses for TCP_KEEPINTVL to a
constant with a different meaning.

Unfortunately there's nothing we can do if we want to support both
illumos and Oracle Solaris with the same GOOS.

Updates #9614.

Change-Id: Id39eb5147f7afa8e951f886c0bf529d00f0e1bd4
Reviewed-on: https://go-review.googlesource.com/7690
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>

@mikioh mikioh modified the milestones: Unplanned, Go1.5 Jun 21, 2015

@binarycrusader

This comment has been minimized.

Contributor

binarycrusader commented Apr 12, 2016

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:

TCP_KEEPIDLE            0x1D
TCP_KEEPINTVL           0x1E

...while they are this on some OpenSolaris-based derivatives:

TCP_KEEPIDLE            0x22
TCP_KEEPINTVL           0x24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment