From e87d5721b73caf4832feb55a2c04d5217d71b809 Mon Sep 17 00:00:00 2001 From: John Keiser Date: Mon, 2 Jun 2014 20:17:20 -0700 Subject: Do not wait for clean exit when Exception is thrown --- lib/chef/chef_fs/parallelizer/parallel_enumerable.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/chef/chef_fs') diff --git a/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb b/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb index 8e50f361db..8845b6926a 100644 --- a/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb +++ b/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb @@ -195,13 +195,15 @@ class Chef process_one end end - ensure - # If someone called "first" or something that exits the enumerator - # early, we want to make sure and throw away any extra results - # (gracefully) so that the next enumerator can start over. + rescue + # If we exited early, perhaps due to any? finding a result, we want + # to make sure and throw away any extra results (gracefully) so that + # the next enumerator can start over. if !finished? stop end + raise + ensure @each_running = false end end -- cgit v1.2.1