This repository was archived by the owner on Apr 30, 2025. It is now read-only.
Use lsof to monitor fds on MacOS #312
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a small fix to be able to run gorouter under MacOS for development purposes.
The PR changes the fd_monitor so that it distinguishes between Linux (which has
/proc) and MacOS (which has not).As a result, this annoying error message will be gone:
Instead of outright removing the fd_monitor functionality, I've opted to make it work under MacOS by shelling out to
lsofto count the open file descriptors. Since gorouter will be deployed to Linux in production scenarios, this may be overkill but I wanted to retain the original functionality and not just turn it off. However, I can also just put in a no-op to turn off the error message instead.An explanation of the use cases your change solves
It allows to develop gorouter under MacOS without breaking the fd_monitor
Instructions to functionally test the behavior change using operator interfaces (BOSH manifest, logs, curl, and metrics)
go buildon MacOSnats-server &./gorouterExpected result after the change
Gorouter starts up, connects to natsd and shows no error messages
Current result before the change
Gorouter starts up, connects to natsd and keeps logging the above error message every 5s
Links to any other associated PRs
I have viewed signed and have submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
scripts/run-unit-tests-in-dockerfrom routing-release.(Optional) I have run Routing Acceptance Tests and Routing Smoke Tests on bosh lite
(Optional) I have run CF Acceptance Tests on bosh lite