From 0e08af41b8103fa37ca723fda5563335a02adf08 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Fri, 18 Oct 2013 10:36:01 -0700 Subject: rest-bench: drain work queue before exiting Fixes: #3896 We assert if workqueue is not empty on shutdown. This makes it so that if there are still running threads, we're going to wait on them. Which means that if there's an error in handling requests, we might wait forever. Signed-off-by: Yehuda Sadeh --- src/tools/rest_bench.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/rest_bench.cc b/src/tools/rest_bench.cc index feea4de4932..b6bdd2b5e18 100644 --- a/src/tools/rest_bench.cc +++ b/src/tools/rest_bench.cc @@ -282,6 +282,9 @@ public: list_bucket_handler.listBucketCallback = list_bucket_callback; } + ~RESTDispatcher() { + req_wq.stop(); + } void process_context(req_context *ctx); void get_obj(req_context *ctx); void put_obj(req_context *ctx); -- cgit v1.2.1