Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

syntect-server freeport detection failing #12999

Closed
slimsag opened this issue Aug 14, 2020 · 4 comments
Closed

syntect-server freeport detection failing #12999

slimsag opened this issue Aug 14, 2020 · 4 comments

Comments

@slimsag
Copy link
Member

slimsag commented Aug 14, 2020

A customer https://app.hubspot.com/contacts/2762526/company/693777200 / https://sourcegraph.slack.com/archives/C011899KB6U/p1597363626348700 reports syntect-server is failing in their EKS cluster with nothing other than:

2020/08/14 00:06:27 worker command: env ROCKET_PORT={{.Port}} /syntect_server
2020/08/14 00:06:27 failed to find free port
2020/08/14 00:06:27 failed to find free port
2020/08/14 00:06:27 failed to find free port
2020/08/14 00:06:27 failed to find free port
2020/08/14 00:06:28 failed to find free port

This behavior happened only recently with no prior changes, indicating that freeport detection was working before in the same deployment but no longer is.

Most likely, this is caused by syntect-server's workers dying and allocating new ports - leading to ephemeral port exhaustion on the EKS host node. However, the logs which indicate which files are problematic appear to not be present (most likely they were paged out due to the number of "failed to find free port" messages.)

https://github.com/sourcegraph/syntect_server makes use of the freeport Go package to spawn worker processes. That package has a number of reported failures 1 2 3 about its localhost-based resolution.

We should adopt a different package and/or phayes/freeport#8 for port allocation and see if that resolves the issue.

@slimsag slimsag added the p1 label Aug 14, 2020
@slimsag slimsag self-assigned this Aug 14, 2020
@pecigonzalo
Copy link
Contributor

The customer managed to start the service by removing http-server-stabilizer as a workaround.

@slimsag
Copy link
Member Author

slimsag commented Aug 20, 2020

You can disable the new freeport library and restore old functionality by setting USE_OLD_FREEPORT=true on the syntax highlighter container if needed, but eventually this will be removed (just an escape hatch in case this change introduces any new issues).

slimsag referenced this issue in sourcegraph/syntect_server Aug 20, 2020
This fixes an issue with free port detection in http-server-stabilizer
found on some systems.

Helps https://github.com/sourcegraph/sourcegraph/issues/12999
@slimsag
Copy link
Member Author

slimsag commented Aug 20, 2020

Fix will be included in 3.19, waiting to confirm with customer that it actually worked.

@slimsag
Copy link
Member Author

slimsag commented Sep 21, 2020

Fix confirmed: https://sourcegraph.slack.com/archives/C011899KB6U/p1600720189004800?thread_ts=1597363626.348700&cid=C011899KB6U

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants