Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3354139
D3648.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
D3648.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D3648: [services] Backup - Send log - add reactor state mutex
Attached
Detach File
Event Timeline
Log In to Comment