Fix segfault in StorageBuffer when exception on server startup (#10609)

* fix segfault in StorageBuffer when exception on server startup

* Trigger CI

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
This commit is contained in:
tavplubix 2020-05-02 19:54:20 +03:00 committed by GitHub
parent a844e66e05
commit a073cd6c79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -161,6 +161,8 @@ public:
task_info->deactivate();
}
operator bool() const { return task_info != nullptr; }
BackgroundSchedulePoolTaskInfo * operator->() { return task_info.get(); }
const BackgroundSchedulePoolTaskInfo * operator->() const { return task_info.get(); }

View File

@ -468,6 +468,9 @@ void StorageBuffer::startup()
void StorageBuffer::shutdown()
{
if (!flush_handle)
return;
flush_handle->deactivate();
try