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

Set TCP_KEEPIDLE=60 if possible #214

Merged
merged 1 commit into from
Nov 2, 2020
Merged

Conversation

talex5
Copy link
Contributor

@talex5 talex5 commented Nov 2, 2020

Cap'n Proto connections tend to be long lived and we therefore turn on the SO_KEEPALIVE option. However, the default keepalive timeout of 2 hours is much too long for some networks. In particular, Docker's libnetwork silently drops idle connections after about 10 minutes.

The OCaml standard library doesn't provide a way to control the timeout, but extunix does.

Cap'n Proto connections tend to be long lived and we therefore turn on
the `SO_KEEPALIVE` option. However, the default keepalive timeout of 2
hours is much too long for some networks. In particular, Docker's
libnetwork silently drops idle connections after about 10 minutes.

The OCaml standard library doesn't provide a way to control the timeout,
but extunix does.
@talex5 talex5 merged commit 53a38de into mirage:master Nov 2, 2020
@talex5 talex5 deleted the keep-alive-time branch November 2, 2020 16:09
talex5 added a commit to talex5/opam-repository that referenced this pull request Dec 28, 2020
…pc and capnp-rpc-unix (0.9.0)

CHANGES:

- Add connection progress indicator (@talex5 mirage/capnp-rpc#220).
  Clients can now use `Capnp_rpc_unix.with_cap_exn` to show a progress indicator while waiting to connect.
  It will use the log if enabled.
  If not, but stderr is a tty, it shows a message while connecting and then erases it (if connecting takes longer than 0.5s).
  If stderr is not a tty, it just prints a message there.

- Use `Mirage_crypto_rng_lwt.initialize` instead of `Mirage_crypto_rng_unix.initialize` (@hannesm mirage/capnp-rpc#217).
  The former periodically feeds entropy to the RNG, while the latter seeds the RNG only once.

- Set TCP_KEEPIDLE=60 if possible (@talex5 mirage/capnp-rpc#214).
  Cap'n Proto connections tend to be long lived and we therefore turn on the `SO_KEEPALIVE` option.
  However, the default keepalive timeout of 2 hours is much too long for some networks.
  In particular, Docker's libnetwork silently drops idle connections after about 10 minutes.

Windows support:

- Prevent crash if ExtUnix wasn't built with sockopt (@MisterDA mirage/capnp-rpc#218).
  If ExtUnix isn't built with sockopt then the symbol `have_sockopt_int` isn't available and an exception is raised.
  This may be the case on some environments (e.g., ExtUnix built with mingw-w64).
  It is a workaround until support for `TCP_KEEPIDLE` is added for these environments (e.g., using Winsock instead).

- There is no SIGPIPE on Windows (@dra27 mirage/capnp-rpc#212).

- Switch from "capnpc" to "capnp compile" (@talex5 mirage/capnp-rpc#213).
  `capnpc` seems to be the old name, and isn't present on Windows.

Build changes:

- Remove Travis and Dockerfile (@talex5 mirage/capnp-rpc#220).
  Travis is very slow and error-prone now, and ocaml-ci generates a working Dockerfile automatically for people who want it.

- Include transitive dependencies in opam files (@talex5 mirage/capnp-rpc#219).
  Patch generated by https://github.com/ocurrent/opam-dune-lint/

- Require `tcpip.unix` specifically to get the checksum stubs linked (@hannesm mirage/capnp-rpc#216).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant