Page MenuHomePhabricator

D3648.diff
No OneTemporary

D3648.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
Sun, Nov 24, 12:00 PM (21 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2575489
Default Alt Text
D3648.diff (1 KB)

Event Timeline