summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2014-06-02 20:17:20 -0700
committerJohn Keiser <jkeiser@opscode.com>2014-06-02 20:17:20 -0700
commite87d5721b73caf4832feb55a2c04d5217d71b809 (patch)
treecaa0671c965d0f7eae195ac0c3c4df9afdd2e972
parent7588211ecb83c9592065359622ff6cef98d773af (diff)
downloadchef-jk/exiterror.tar.gz
Do not wait for clean exit when Exception is thrownjk/exiterror
-rw-r--r--lib/chef/chef_fs/parallelizer/parallel_enumerable.rb10
1 files changed, 6 insertions, 4 deletions
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