Skip to content
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: time unit used for TCP keep-alive on DragonFlyBSD should be seconds #65809

Closed
panjf2000 opened this issue Feb 20, 2024 · 1 comment
Closed
Assignees
Labels
NeedsFix The path to resolution is known, but the work has not been done. OS-Dragonfly
Milestone

Comments

@panjf2000
Copy link
Member

panjf2000 commented Feb 20, 2024

After CL 542275 was merged into the master branch, I played around with this new feature along with investigating some known issues like #64251. As a result of which, I discovered a few issues and potential improvements on different platforms.

For the starter, DragonFlyBSD switched the time unit for TCP keep-alive from milliseconds to seconds since v5.8 while Go still uses milliseconds up to now (CL 542275 wasn't aware of it):

func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
// The kernel expects milliseconds so round to next highest
// millisecond.
msecs := int(roundDurationUp(d, time.Millisecond))
if err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, syscall.TCP_KEEPINTVL, msecs); err != nil {
return wrapSyscallError("setsockopt", err)
}
err := fd.pfd.SetsockoptInt(syscall.IPPROTO_TCP, syscall.TCP_KEEPIDLE, msecs)

I think that we need to keep Go in sync with that considering that Go makes no guarantee to support any older versions of DragonFlyBSD other than the latest one:

Generally only the latest release version only. We have a builder, but it’s not the most stable of our ports.

References:

@panjf2000 panjf2000 added OS-Dragonfly NeedsFix The path to resolution is known, but the work has not been done. labels Feb 20, 2024
@panjf2000 panjf2000 added this to the Go1.23 milestone Feb 20, 2024
@gopherbot
Copy link

Change https://go.dev/cl/565315 mentions this issue: net: harmonize the time units used for TCP keep-alive on DragonFly and other UNIX's by seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. OS-Dragonfly
Projects
None yet
Development

No branches or pull requests

2 participants