From e94dbda12b842de9b0d4527e0736aadc5298c027 Mon Sep 17 00:00:00 2001 From: Huang Liang Date: Mon, 9 Jan 2012 15:11:20 +1100 Subject: [PATCH 1/2] Version bump to 0.1.3 --- VERSION.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VERSION.yml b/VERSION.yml index d0c4551..149e43e 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,4 +1,5 @@ --- :minor: 1 -:patch: 2 +:patch: 3 :major: 0 +:build: From 846f360ee7e0ebd8855f72220f5946d56087f8d7 Mon Sep 17 00:00:00 2001 From: Huang Liang Date: Mon, 9 Jan 2012 15:41:31 +1100 Subject: [PATCH 2/2] Raise error when subthreads fail. Directly return will make the cap process return 0 even if subthreads fail. It should raise error instead. --- .../configuration/extensions/actions/invocation.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/capistrano/configuration/extensions/actions/invocation.rb b/lib/capistrano/configuration/extensions/actions/invocation.rb index f527375..4ee7df6 100644 --- a/lib/capistrano/configuration/extensions/actions/invocation.rb +++ b/lib/capistrano/configuration/extensions/actions/invocation.rb @@ -1,4 +1,7 @@ module Capistrano + + ParallelError = Class.new(Capistrano::Error) + class Configuration module Extensions module Actions @@ -34,7 +37,7 @@ def run_parallelize_loop(proxy, thread_count) threads = run_in_threads(chunk) all_threads << threads wait_for(threads) - rollback_all_threads(all_threads.flatten) and return if threads.any? {|t| t[:rolled_back] || t[:exception_raised]} + rollback_all_threads(all_threads.flatten) and raise ParallelError.new("Subthread failed in parallel running, rolled back.") if threads.any? {|t| t[:rolled_back] || t[:exception_raised]} batch += 1 end all_threads @@ -81,4 +84,4 @@ def rollback_all_threads(threads) end end end -end \ No newline at end of file +end