Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3562635
D4089.id12933.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4089.id12933.diff
View Options
diff --git a/services/backup/src/Reactors/server/AddAttachmentReactor.cpp b/services/backup/src/Reactors/server/AddAttachmentReactor.cpp
--- a/services/backup/src/Reactors/server/AddAttachmentReactor.cpp
+++ b/services/backup/src/Reactors/server/AddAttachmentReactor.cpp
@@ -120,6 +120,23 @@
}
void AddAttachmentReactor::terminateCallback() {
+ const std::lock_guard<std::mutex> lock(this->reactorStateMutex);
+
+ if (this->putReactor == nullptr) {
+ throw std::runtime_error(
+ "invalid state: put reactor not initialized when terminating the "
+ "reactor");
+ }
+ 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()) {
+ throw std::runtime_error(
+ this->putReactor->getStatusHolder()->getStatus().error_message());
+ }
+ // store in db only when we successfully upload chunks
+ this->storeInDatabase();
}
} // namespace reactor
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 28, 10:58 AM (7 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2725844
Default Alt Text
D4089.id12933.diff (1 KB)
Attached To
Mode
D4089: [services] Backup - Add Attachment Reactor - terminate callback
Attached
Detach File
Event Timeline
Log In to Comment