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

Don't crash when there is a leftover socket file #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Don't crash when there is a leftover socket file #13

wants to merge 1 commit into from

Conversation

takano-akio
Copy link
Contributor

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)

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)
@bitc
Copy link
Owner

bitc commented Feb 24, 2013

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.

@takano-akio
Copy link
Contributor Author

It mainly happens when I have to kill a hdevtools process with SIGKILL.

@bitc
Copy link
Owner

bitc commented Mar 7, 2013

The proper way to stop the hdevtools process is to run hdevtools --stop-server

This should make sure that the socket file is cleaned up.

@takano-akio
Copy link
Contributor Author

Yes, I know that. However when the machine is running out of memory hdevtools --stop-server is often too slow.

Also I believe that the socket file will be left on hard reset of the computer, for example.

@lightquake
Copy link

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.

@bmjames
Copy link

bmjames commented Jan 24, 2014

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.

@jergason
Copy link

jergason commented Mar 1, 2015

I ended up with a leftover .hdevtools.sock file that caused the same error. It may have been caused by a hard-reset. It manifested as vim-hdevtools silently failing to check for errors, which took a bit to track down.

I'd love to see this merged in.

@sgillis
Copy link

sgillis commented May 26, 2015

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.

@schell
Copy link

schell commented May 27, 2015

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).

@schell
Copy link

schell commented May 27, 2015

I'll have to merge this into my branch, @bitc isn't active in this repo as far as I know.

@schell
Copy link

schell commented May 31, 2015

I've merged this request into my fork and pushed it up to hackage.

dan-t pushed a commit to dan-t/hdevtools that referenced this pull request Oct 18, 2015
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.

7 participants