From a991bcfe612c6e045e27a0ef34af476f83b7f6e8 Mon Sep 17 00:00:00 2001 From: nitsanw <nitsanw@yahoo.com> Date: Thu, 15 Jan 2015 11:31:59 +0200 Subject: [PATCH] [client] Wait for status thread to properly exit in shutdown sequence --- core/src/main/java/com/yahoo/ycsb/Client.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/yahoo/ycsb/Client.java b/core/src/main/java/com/yahoo/ycsb/Client.java index 4c9809a7..80a4a86f 100644 --- a/core/src/main/java/com/yahoo/ycsb/Client.java +++ b/core/src/main/java/com/yahoo/ycsb/Client.java @@ -800,7 +800,13 @@ public class Client if (status) { - statusthread.interrupt(); + // wake up status thread if it's asleep + statusthread.interrupt(); + // at this point we assume all the monitored threads are already gone as per above join loop. + try { + statusthread.join(); + } catch (InterruptedException e) { + } } try -- GitLab