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

deprecate the use of LIBP2P_TCP_REUSEPORT #103

Closed
wants to merge 2 commits into from

Conversation

marten-seemann
Copy link
Contributor

Now that we have constructor options (and make them actually usable with libp2p/go-libp2p#1205), we don't need to control reuseport using environment variables any more. Just pass tcp.DisableReuseport() to the transport constructor instead.

This PR:

  1. removes support for the ancient IPFS_REUSEPORT option, which was deprecated in 2018 (Deprecate IPFS_REUSEPORT, use LIBP2P_TCP_REUSEPORT #27)
  2. deprecates the LIBP2P_TCP_REUSEPORT, displaying a warning when this env is set

@Stebalien
Copy link
Member

I'd keep it, honestly. I'm usually not a fan of environment variables, but this one really is a global option. It's useful when a user has issues caused by reuseport and wants to disable it globally (even if the user's application doesn't directly support such a configuration option).

Libc has a few standard environment variables as well for similar reasons: https://www.gnu.org/software/libc/manual/html_node/Standard-Environment.html

The option is independently useful in case the application wants to manually enable/disable it. The environment variable is basically just a global override.

@marten-seemann
Copy link
Contributor Author

I didn't realize reuseport is something that would cause problems depending on your system configuration. If that's the case, I agree that an env is appropriate.

I'll extract the removal of the IPFS_REUSEPORT flag into a separate PR.

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.

2 participants