Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Skip SetKeepAlivePeriod call on OpenBSD #80

Merged
merged 1 commit into from Jun 24, 2021

Conversation

qbit
Copy link
Contributor

@qbit qbit commented Jun 23, 2021

OpenBSD does not have a user-settable per-socket TCP keepalives. This changes
tryKeepAlive to skip attempting set it when on OpenBSD.

https://github.com/golang/go/blob/master/src/net/tcpsockopt_openbsd.go#L13-L14

This prevents thousands of log.Errorf("Failed set keepalive period: %s", err)'s from happening.

OpenBSD does not have a user-settable per-socket TCP keepalives. This changes
tryKeepAlive to skip attempting set it when on OpenBSD.

  https://github.com/golang/go/blob/master/src/net/tcpsockopt_openbsd.go#L13-L14

This prevents thousands of `log.Errorf("Failed set keepalive period: %s",
err)`'s from happening.
@marten-seemann marten-seemann self-requested a review June 23, 2021 17:29
@marten-seemann
Copy link
Contributor

How would one set the keep alive period on OpenBSD then? I find it hard to believe it's not possible to set it at all.

@qbit
Copy link
Contributor Author

qbit commented Jun 23, 2021

Root can diddle various keepalive properties to change the behavior via the sysctl, but there is no way for non-root user to do it.

@marten-seemann
Copy link
Contributor

Ok, I guess OpenBSD users then have to live with a slightly suboptimal behavior then.

@marten-seemann marten-seemann merged commit 1b96803 into libp2p:master Jun 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants