Skip to content

Commit 5035ffc

Browse files
committed
Fix potential race condition in stopping CloudLogController
1 parent 3ec8634 commit 5035ffc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cloud/cloud_env_impl.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "cloud/cloud_env_impl.h"
77
#include "cloud/cloud_env_wrapper.h"
8+
#include "cloud/cloud_log_controller.h"
89
#include "cloud/filename.h"
910
#include "cloud/manifest_reader.h"
1011
#include "port/likely.h"
@@ -22,7 +23,12 @@ namespace rocksdb {
2223
CloudEnvImpl::CloudEnvImpl(const CloudEnvOptions& opts, Env* base, const std::shared_ptr<Logger>& l)
2324
: CloudEnv(opts, base, l), purger_is_running_(true) {}
2425

25-
CloudEnvImpl::~CloudEnvImpl() { StopPurger(); }
26+
CloudEnvImpl::~CloudEnvImpl() {
27+
if (cloud_log_controller_) {
28+
cloud_log_controller_->StopTailingStream();
29+
}
30+
StopPurger();
31+
}
2632

2733
void CloudEnvImpl::StopPurger() {
2834
{

0 commit comments

Comments
 (0)