Skip to content

create sockets with SO_REUSEPORT option #164

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
wants to merge 2 commits into from

Conversation

viuginick1
Copy link
Collaborator

@viuginick1 viuginick1 commented Jan 21, 2019

Often in the case of a remote connection, there is a problem with the fact that debugger use several ports in case of multi-process applications. It turns out that there is an opportunity to create several sockets on the same port - REUSEPORT(REUSEADDR in case of windows)(https://stackoverflow.com/a/14388707/4863418)
According this answer REUSEPORT will work on linux starting with 3.9 kernel version(which was released back in 2013 so we are OK)

Old workaround: #73

@vivekcoer
Copy link

Why is this not merged yet? This fixes a very important bug..

@carlobeltrame
Copy link

I am also very interested in having this merged and released. What is blocking it?

carlobeltrame added a commit to carlobeltrame/hitobito-docker that referenced this pull request Dec 3, 2019
As similarly proposed in ruby-debug/ruby-debug-ide#107
This hack is necessary as long as ruby-debug/ruby-debug-ide#164 is not merged and released because:
* We cannot easily modify the Gemfile because it is not in the same repository. So we need to use `gem install` in the Dockerfile to do it
* The newest RubyMine requires a prerelease version of ruby-debug-ide
* The fix with SO_REUSEPORT is only available on a specific branch of a specific fork, which is not up-to-date with the prerelease version
* We cannot use the monkey-patch in an initializer as proposed in the issue, because wagon:test doesn't run Rails and thus doesn't consider the initializers

The combination of these three aspects renders it impossible to easily install a version that includes the fix.
So instead, we simply overwrite the relevant code inside the bundle with something that works for our case for now.
As soon as the PR is merged and released, we can revert to installing the official, unaltered version into our docker container.
@avantjustus
Copy link

🙏

@viuginick1
Copy link
Collaborator Author

@avantjustus @carlobeltrame @vivekcoer Did you tried the version from the branch? Because AFAIR I put it off because it fails pretty often

carlobeltrame added a commit to carlobeltrame/hitobito-docker that referenced this pull request Feb 25, 2020
As similarly proposed in ruby-debug/ruby-debug-ide#107
This hack is necessary as long as ruby-debug/ruby-debug-ide#164 is not merged and released because:
* We cannot easily modify the Gemfile because it is not in the same repository. So we need to use `gem install` in the Dockerfile to do it
* The newest RubyMine requires a prerelease version of ruby-debug-ide
* The fix with SO_REUSEPORT is only available on a specific branch of a specific fork, which is not up-to-date with the prerelease version
* We cannot use the monkey-patch in an initializer as proposed in the issue, because wagon:test doesn't run Rails and thus doesn't consider the initializers

The combination of these three aspects renders it impossible to easily install a version that includes the fix.
So instead, we simply overwrite the relevant code inside the bundle with something that works for our case for now.
As soon as the PR is merged and released, we can revert to installing the official, unaltered version into our docker container.
@hurricup
Copy link
Contributor

Closing this as abandoned

@hurricup hurricup closed this Jan 12, 2021
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.

5 participants