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

Unlink socket file when exists. #8978

Closed
wants to merge 1 commit into from

Conversation

yukimochi
Copy link
Contributor

When exists socket file which created in previous process, streaming raise error looping and use 100% cpu time.

This avoid above problem by unlink existing files which given socket path.

@Gargron
Copy link
Member

Gargron commented Oct 13, 2018

The same problem occurs when port is taken, the workers try to restart infinitely.

Does other software also delete the socket on startup? What if you accidentally start two at the same time, I feel like the socket should be a safeguard against that.

So maybe it's possible to check existence of socket / availability of port in the master process before clustering happens?

@yukimochi
Copy link
Contributor Author

yukimochi commented Oct 13, 2018

I don't know ideal treat ...
But in puma, when existing file given socket path it delete file and start.

  • In puma
    clustering happen -> There is already a server bound to: socket/puma.sock (RuntimeError) in secondary
    (Previous process is still working well.)
  • In node (applied this PR)
    clustering happen -> ERR! Error: bind EADDRINUSE socket/node.sock in secondary
    (Previous process is still working well.)

I think this changes makes no effect about clustering problem.

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.

None yet

2 participants