Page MenuHomePhabricator

D4321.id14311.diff
No OneTemporary

D4321.id14311.diff

diff --git a/services/backup/src/Reactors/server/SendLogReactor.cpp b/services/backup/src/Reactors/server/SendLogReactor.cpp
--- a/services/backup/src/Reactors/server/SendLogReactor.cpp
+++ b/services/backup/src/Reactors/server/SendLogReactor.cpp
@@ -132,15 +132,27 @@
void SendLogReactor::terminateCallback() {
const std::lock_guard<std::mutex> lock(this->reactorStateMutex);
+ if (!this->getStatusHolder()->getStatus().ok()) {
+ throw std::runtime_error(
+ this->getStatusHolder()->getStatus().error_message());
+ }
+
+ if (this->persistenceMethod != PersistenceMethod::BLOB &&
+ this->persistenceMethod != PersistenceMethod::DB) {
+ throw std::runtime_error("Invalid persistence method detected");
+ }
+
if (this->persistenceMethod == PersistenceMethod::DB ||
this->putReactor == nullptr) {
+ this->storeInDatabase();
return;
}
this->putReactor->scheduleSendingDataChunk(std::make_unique<std::string>(""));
std::unique_lock<std::mutex> lockPut(this->blobPutDoneCVMutex);
if (this->putReactor->getStatusHolder()->state != ReactorState::DONE) {
this->blobPutDoneCV.wait(lockPut);
- } else if (!this->putReactor->getStatusHolder()->getStatus().ok()) {
+ }
+ if (!this->putReactor->getStatusHolder()->getStatus().ok()) {
throw std::runtime_error(
this->putReactor->getStatusHolder()->getStatus().error_message());
}

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 5:18 AM (18 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2685929
Default Alt Text
D4321.id14311.diff (1 KB)

Event Timeline