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

Errno::EBADF in `DevServer.running? #876

Closed
ketan opened this issue Sep 28, 2017 · 1 comment
Closed

Errno::EBADF in `DevServer.running? #876

ketan opened this issue Sep 28, 2017 · 1 comment

Comments

@ketan
Copy link
Contributor

ketan commented Sep 28, 2017

See similar issue #745.

I'm running on jruby 9.1.13.0 and getting a Errno::EBADF when the webpack dev server is not running. Perhaps it's appropriate to catch all exceptions here and return a false? I can submit a PR if the solution is acceptable.

def running?
Socket.tcp(host, port, connect_timeout: connect_timeout).close
true
rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, NoMethodError
false
end

@gauravtiwari
Copy link
Member

Yes, please feel free to submit a PR 👍

ketan added a commit to ketan/webpacker that referenced this issue Sep 29, 2017
Catch all exceptions in `DevServer.running?` and return false.
This is required because some ruby implementations (particularly
`jruby 9.1.13.0` throws a `Errno::EBADF`) which ends up being uncaught
and blows up the stack with no indication as to why the error happened.
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

No branches or pull requests

2 participants