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>
This commit is contained in:
Avi Kivity
2016-01-06 17:06:45 +02:00
committed by Pekka Enberg
parent 973c62a486
commit fbe3283816

View File

@@ -149,9 +149,10 @@ public:
virtual void set_local_private_addr(const sstring& addr_str) {};
static distributed<snitch_ptr>& snitch_instance() {
static distributed<snitch_ptr> snitch_inst;
// FIXME: leaked intentionally to avoid shutdown problems, see #293
static distributed<snitch_ptr>* snitch_inst = new distributed<snitch_ptr>();
return snitch_inst;
return *snitch_inst;
}
static snitch_ptr& get_local_snitch_ptr() {