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

fsevent_watch abnormal termination fails silently, burns cpu #80

Closed
thefloweringash opened this issue Aug 31, 2017 · 2 comments
Closed

Comments

@thefloweringash
Copy link

thefloweringash commented Aug 31, 2017

In irb, run the example in a thread.

require 'rb-fsevent'

fsevent = FSEvent.new
fsevent.watch Dir.pwd do |directories|
  puts "Detected change inside: #{directories.inspect}"
end
Thread.new { fsevent.run }

Then abnormally terminate fsevent_watch. (Press C-c, or pkill fsevent_watch, or attach a debugger to fsevent_watch, etc)

At this point, there's a zombie process:

76993 s012  Z+     0:00.00 (fsevent_watch)

And the ruby interpreter is looping as hard as it can reading nothing from the pipe which is at eof https://github.com/thibaudgg/rb-fsevent/blob/0b8b7367a392d9957344f43d9ed125f011a64e5d/lib/rb-fsevent/fsevent.rb#L55

Ruby: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
Version: rb-fsevent-0.10.2

@saluzafa
Copy link
Contributor

I managed to fix it, please see pull request #81 or https://github.com/saluzafa/rb-fsevent

@thibaudgg
Copy link
Member

Closed by #81

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

3 participants