-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Comments
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. |
Mikio, do you know what a good TCP_KEEPCNT value is? |
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. |
CL https://golang.org/cl/7690 mentions this issue. |
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>
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:
|
Change https://go.dev/cl/577195 mentions this issue: |
Hi @binarycrusader, first thank you for the helpful tips! I'm working on CL 577195 that sets |
Never mind, I've found it in Rust libc. |
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 text was updated successfully, but these errors were encountered: