From b4b76850e37343f5ffe1234f892bb70d5ed0ce3a Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 9 Jul 2020 23:00:16 +0200 Subject: [PATCH] Added check for removed data page during data ingest, shuts down binary to prevent crash --- src/io.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/io.cpp b/src/io.cpp index d8a37a12..56988814 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -8,6 +8,7 @@ #include //LTS #include #include +#include namespace Mist{ InOutBase::InOutBase() : M(meta){} @@ -404,6 +405,15 @@ namespace Mist{ return; } + if (curPage.count(packTrack) && !curPage[packTrack].exists()){ + WARN_MSG("Data page was deleted - forcing source shutdown to prevent unstable state"); + Util::logExitReason("data page was deleted, forcing shutdown to prevent unstable state"); + bufferFinalize(packTrack); + kill(getpid(), SIGINT); + return; + } + + if (!curPageNum.count(packTrack) || nextPageNum != curPageNum[packTrack]){ if (curPageNum.count(packTrack)){ // Close the currently opened page when it exists