-
Notifications
You must be signed in to change notification settings - Fork 42
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
Don't crash when there is a leftover socket file #13
base: master
Are you sure you want to change the base?
Conversation
Previously, when there was a socket file in the current directly and no server was running, 'hdevtools check' would fail with: hdevtools: bind: resource busy (Address already in use)
I'll have to think about this... Can you please explain under what circumstances you end up with the leftover socket file? It should usually be automatically deleted when the hdevtools server exits. |
It mainly happens when I have to kill a hdevtools process with SIGKILL. |
The proper way to stop the hdevtools process is to run This should make sure that the socket file is cleaned up. |
Yes, I know that. However when the machine is running out of memory Also I believe that the socket file will be left on hard reset of the computer, for example. |
I can't say I've been bitten by this, but I think it's best to remove stale socket files because hdevtools could require a kill -9, or it might get killed by something else beyond user control, etc. |
I found this pull request when I encountered the same problem. I do not know how I ended up with the stale socket file, but there it was, so I had to solve the problem some way. Perhaps the program could at least exit with a more descriptive message about the stale socket file. If the message included the path to the file, it would be completely obvious what the user needs to do to fix the problem. |
I ended up with a leftover I'd love to see this merged in. |
I encountered this when running hdevtools inside a Docker container with host volumes mounted into the container. When the container is removed the stale socket remains on the host system. |
I am constantly removing this socket file to re-check after making changes to included libraries so I don't see the harm in automating it (at least in certain circumstances). |
I'll have to merge this into my branch, @bitc isn't active in this repo as far as I know. |
I've merged this request into my fork and pushed it up to hackage. |
Findsymbol command :+1:
When there is a socket file in the current directly and no server is running, 'hdevtools check' fails with:
hdevtools: bind: resource busy (Address already in use)