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

Riddle::Controller#stop doesn't give back any useful information, doesn't always work #6

Closed
mtodd opened this issue Aug 26, 2010 · 2 comments

Comments

@mtodd
Copy link
Contributor

mtodd commented Aug 26, 2010

Process.kill returns as soon as the system call goes through but sometimes the process hangs around and can cause running? to see that it's still running and can cause problems for tasks that need to restart Sphinx.

It would be useful to return the result of running? after calling Process.kill. This way we could retry or wait until it truly is no longer running. Or, possibly returning !running? to indicate that it was stopped or wasn't.

Alternatively, we could handle polling running? until it actually is stopped and then return.

@pat
Copy link
Owner

pat commented Aug 28, 2010

Hi Matt

I've changed #stop so it returns !running? - ie: an indication that Sphinx is not running, as you've suggested. Not sure when I'll get to the TS ticket for this too, but I was just on a roll with Riddle tonight :)

Cheers

@mtodd
Copy link
Contributor Author

mtodd commented Aug 28, 2010

Awesome, I was going to fork and submit a pull request if you gave the go ahead. That's really all I was waiting for, haha.

I don't mind doing the legwork on the TS ticket but there are several options and I wanted your feedback before I started. This fix is fairly integral, though.

Another thing is if Riddle::Controller#stop is called and it finally has stopped, I think it raises Errno::ESRCH (couldn't find process) error, so we might want to rescue for that error and return true in that case (as in, it's no longer running but was when last we tested if it was running).

This issue was closed.
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