-
Notifications
You must be signed in to change notification settings - Fork 82
Add fixed port range for sub-processor debugger #203
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
Closed
mrbiggred
wants to merge
70
commits into
ruby-debug:master
from
corgibytes:feature-add-fixed-port-range
Closed
Add fixed port range for sub-processor debugger #203
mrbiggred
wants to merge
70
commits into
ruby-debug:master
from
corgibytes:feature-add-fixed-port-range
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now correctly handles StandardError instead of ArgumentError.
Old versions of Ruby not supported by Ruby Build action.
Docker container for development
Create GitHub CI
Trigger CI on PR
Get latest changes from Ruby Debug IDE origin
Trigger CI on push and PR
Add Standard lint checker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #107. For those that don't want the read the really long #107 issue a TL;DR version is below.
When debugging a multi-process server, such as Unicorn or Passenger, inside a Docker container the debugger will hang when it tries to spawn a sub-debugger.
This happens even if all the recommended ports are open in:
The issue occurs because the sub-process uses a random open port but it is unlikely that port is open in your Docker container.
My fix was to use a fixed range of ports so you could open them in your Docker config. I choose 58430-58450. If anyone has a better range or thinks 20 ports is too many or too few let me know. I'm also happy to discuss being able to set the sub-process ports dynamically via the command line either in this PR or a future PR.
I wasn't sure the best way to unit test this change. For now I've just removed the mock
find_free_port
so the tests use the realfind_free_port
method. If anyone has a better way to test this fix please let me know.Feedback is much appreciated.