From 8fb49f10cca5bca43fdf5f96bc6aed31c6b21006 Mon Sep 17 00:00:00 2001 From: Nikhil Benesch Date: Sat, 26 Apr 2014 16:05:58 -0400 Subject: [PATCH] command/rsync-auto: properly exit on interrupt Currently, interrupting 'vagrant rsync-auto' once it's waiting for filesystem events has no effect. Appears to be a deadlock related to signal handlers in Ruby 2.0 [0]. Remove call to `thread.join` in signal handler. The handler doesn't need to wait for `true` to be added to the queue; it just needs to launch the thread. [0]: https://bugs.ruby-lang.org/issues/7917 --- plugins/synced_folders/rsync/command/rsync_auto.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/synced_folders/rsync/command/rsync_auto.rb b/plugins/synced_folders/rsync/command/rsync_auto.rb index 8bb658c5d..c18c600f3 100644 --- a/plugins/synced_folders/rsync/command/rsync_auto.rb +++ b/plugins/synced_folders/rsync/command/rsync_auto.rb @@ -114,7 +114,7 @@ module VagrantPlugins callback = lambda do # This needs to execute in another thread because Thread # synchronization can't happen in a trap context. - Thread.new { queue << true }.join + Thread.new { queue << true } end # Run the listener in a busy block so that we can cleanly