-
Notifications
You must be signed in to change notification settings - Fork 37
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
Problems running watcher in a thread #39
Comments
The code is using IO.popen to interact with the subprocess, which i'm assuming uses an rb_ensure c api call to wait on process termination and prevent it from becoming a zombie. if you kill the thread, i don't think rb_ensure hooks (or normal ruby ensure blocks) get called. 😕 Are you able to share a reduced test-case as an example? |
you may be interested in testing against master due to a recent merge: #40 |
Permit me to beg your forgiveness for mistaking my own problem for a problem with your gem. I was confused as to why the listener process remains running even after Ruby should no longer be using it. The real problem, however, was my app creating a pidfile, and since rspec doesn't fork, the pidfile wasn't getting released after each test. Thus, subsequent tests were blocked on locking the pidfile. I factored out the pidfile stuff and now everything is normal. For me, the issue is resolved. However, if you would like to pursue the threading issue let me know and I will provide you with demonstration code. |
I have a test that starts a watcher in a thread (via guard/listen), sleeps, and then makes a file change that the watcher should pick up.
About 90% of the time, it appears that the watcher never even gets set up, for some reason I can't determine.
However, when it does get set up, it never terminates. The fsevent_watch process remains running even after I have killed the thread. This means that my Ruby process also remains running.
What is the proper way to ensure termination of that process (and thereby my Ruby process)?
Thanks for any help you can provide.
The text was updated successfully, but these errors were encountered: