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

Improve reliability of ServiceClient #61

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexrsagen
Copy link

This PR intends to improve the reliability of ServiceClient, by:

  • Making use of ureq::Agent and its connection pool (leaving the size of the connection pool at the default of 1 connection). This makes ServiceClient able to re-use connections, reducing the amount of lingering TCP connections in TIME_WAIT state in the case that the ZeroTierOne service is not available.
  • Attempting IPv6 connection to localhost if an IPv4 connection to localhost failed, and vice-versa. This is a mostly a work-around for Unable to connect to the ZeroTierOne service HTTP API via IPv4 ZeroTierOne#2342, but could be useful in other (weird) situations. It should not cause any harm.

This avoids always creating new connections, leading to excessive lingering TCP connections in TIME_WAIT state if the ZeroTier system service is unavailable.
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