Try fix crash in StorageBuffer

This commit is contained in:
proller 2018-09-06 18:06:54 +03:00
parent b32e0c48af
commit 6d8b1bea4b
2 changed files with 11 additions and 0 deletions

View File

@ -63,6 +63,16 @@ StorageBuffer::StorageBuffer(const std::string & name_, const ColumnsDescription
{ {
} }
StorageBuffer::~StorageBuffer()
{
// Should not happen if shutdown was called
if (flush_thread.joinable())
{
shutdown_event.set();
flush_thread.join();
}
}
/// Reads from one buffer (from one block) under its mutex. /// Reads from one buffer (from one block) under its mutex.
class BufferBlockInputStream : public IProfilingBlockInputStream class BufferBlockInputStream : public IProfilingBlockInputStream

View File

@ -131,6 +131,7 @@ protected:
Context & context_, Context & context_,
size_t num_shards_, const Thresholds & min_thresholds_, const Thresholds & max_thresholds_, size_t num_shards_, const Thresholds & min_thresholds_, const Thresholds & max_thresholds_,
const String & destination_database_, const String & destination_table_, bool allow_materialized_); const String & destination_database_, const String & destination_table_, bool allow_materialized_);
~StorageBuffer();
}; };
} }