Page MenuHomePhabricator

D3648.id11395.diff
No OneTemporary

D3648.id11395.diff

diff --git a/services/backup/docker-server/contents/server/src/Reactors/server/SendLogReactor.h b/services/backup/docker-server/contents/server/src/Reactors/server/SendLogReactor.h
--- a/services/backup/docker-server/contents/server/src/Reactors/server/SendLogReactor.h
+++ b/services/backup/docker-server/contents/server/src/Reactors/server/SendLogReactor.h
@@ -40,6 +40,7 @@
// `persistedInBlob` is false) or the holder to blob (if `persistedInBlob` is
// true)
std::string value;
+ std::mutex reactorStateMutex;
std::condition_variable blobDoneCV;
std::shared_ptr<reactor::BlobPutClientReactor> putReactor;
@@ -94,6 +95,9 @@
std::unique_ptr<grpc::Status>
SendLogReactor::readRequest(backup::SendLogRequest request) {
+ // we make sure that the blob client's state is flushed to the main memory
+ // as there may be multiple threads from the pool taking over here
+ const std::lock_guard<std::mutex> lock(this->reactorStateMutex);
switch (this->state) {
case State::USER_ID: {
if (!request.has_userid()) {
@@ -150,6 +154,9 @@
}
void SendLogReactor::doneCallback() {
+ // we make sure that the blob client's state is flushed to the main memory
+ // as there may be multiple threads from the pool taking over here
+ const std::lock_guard<std::mutex> lock(this->reactorStateMutex);
// TODO implement
std::cout << "receive logs done " << this->status.error_code() << "/"
<< this->status.error_message() << std::endl;

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 6:26 AM (19 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2593057
Default Alt Text
D3648.id11395.diff (1 KB)

Event Timeline