From fbe3283816911a3a275a46d5c5a46ea176bee3d2 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Wed, 6 Jan 2016 17:06:45 +0200 Subject: [PATCH] snitch: intentionally leak snitch singleton Because our shutdown process is crippled (refs #293), we won't shutdown the snitch correctly, and the sharded<> instance can assert during shutdown. This interferes with the next patch, which adds orderly shutdown if the http server fails to start. Leak it intentionally to work around the problem. Message-Id: <1452092806-11508-2-git-send-email-avi@scylladb.com> --- locator/snitch_base.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locator/snitch_base.hh b/locator/snitch_base.hh index 35145ea453..a56eccce69 100644 --- a/locator/snitch_base.hh +++ b/locator/snitch_base.hh @@ -149,9 +149,10 @@ public: virtual void set_local_private_addr(const sstring& addr_str) {}; static distributed& snitch_instance() { - static distributed snitch_inst; + // FIXME: leaked intentionally to avoid shutdown problems, see #293 + static distributed* snitch_inst = new distributed(); - return snitch_inst; + return *snitch_inst; } static snitch_ptr& get_local_snitch_ptr() {