
On Tue, Oct 20, 2020 at 10:57:09AM +0800, Xu Xijian wrote:
On Tue, Oct 20, 2020 at 09:12:35AM +0800, Xiao Shenwei wrote:
[why] when run multi-docker job on physical machine, run 50 client to request job, if server down or error like Connection refused. these client willexit. when the server recovers, need to run these client again.
[how] add exception handing to ensure all client does not exit
Signed-off-by: Xiao Shenwei <xiaoshenwei96@163.com> --- providers/docker/docker.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/providers/docker/docker.rb b/providers/docker/docker.rb index c241d3c..3600025 100755 --- a/providers/docker/docker.rb +++ b/providers/docker/docker.rb @@ -88,6 +88,19 @@ def main(hostname) run(hostname, load_path, hash) end
+def loop_main(hostname) + loop do + begin + main(hostname) + rescue StandardError => e + puts e.backtrace + sleep 25
Would you like to add some brief comment here for the Latecomers?
ok, Thanks, Shenwei
Thanks, Xijian
+ ensure + sleep 5 + end + end +end +