Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Dec 28, 2012
@dbussink dbussink Handle potential race condition when stopping
The race conditionn is the following. When a FSEvent#stop is called, it
kills the child process and closes the pipe. It can happen that the kill
signal is sent and then succesfully the pipe is closed, before the child
process dies and the pipe in the parent is closed.

This means that IO::select() can raise a Errno::EBADF if the file
descriptor is closed while waiting in select(). This additional rescue
makes sure we shutdown in this case just like any others. This is a much
more reliable solution than adding for example a sleep() between
Process.kill and @pipe.close in FSEvent#stop.

Found because of rubinius/rubinius#2102.
75f1b9c
@ttilley ttilley Merge pull request #40 from rubinius/master
Fix race condition in stopping FSEvent runner
fa8ad08
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/rb-fsevent/fsevent.rb
View
2  lib/rb-fsevent/fsevent.rb
@@ -43,7 +43,7 @@ def run
callback.call(modified_dir_paths)
end
end
- rescue Interrupt, IOError
+ rescue Interrupt, IOError, Errno::EBADF
ensure
stop
end

No commit comments for this range

Something went wrong with that request. Please try again.