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