From 9533ff12ddd5d2fab161381d27ed3c964f4f1c9d Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Sun, 22 Sep 2019 05:12:55 +0300 Subject: [PATCH] Merge pull request #7032 from azat-archive/distributed-directory-monitor-SIGSEGV Avoid SIGSEGV on batch send failure (file with index XX is absent) (cherry picked from commit 5970aafd9aa5f1c885365297dfdb3d10fec8fdb8) --- dbms/src/Storages/Distributed/DirectoryMonitor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Storages/Distributed/DirectoryMonitor.cpp b/dbms/src/Storages/Distributed/DirectoryMonitor.cpp index 13c9cf3050a..6d5bffe3491 100644 --- a/dbms/src/Storages/Distributed/DirectoryMonitor.cpp +++ b/dbms/src/Storages/Distributed/DirectoryMonitor.cpp @@ -390,7 +390,8 @@ struct StorageDistributedDirectoryMonitor::Batch remote->writePrepared(in); } - remote->writeSuffix(); + if (remote) + remote->writeSuffix(); } catch (const Exception & e) {