Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: drop bug of wal on mq, can't not drop runtime #433

Merged
merged 2 commits into from
Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions wal/src/message_queue_impl/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ pub struct Namespace<M: MessageQueue> {

/// Handle for cleaner routine
cleaner_handle: TaskHandle,

/// Background runtime for cleaner routine
///
/// Keep it here to ensure it won't be drop during the lifetime of
/// [Namespace].
bg_runtime: Arc<Runtime>,
}

impl<M: MessageQueue> Namespace<M> {
Expand All @@ -163,7 +157,6 @@ impl<M: MessageQueue> Namespace<M> {
Self {
inner,
cleaner_handle,
bg_runtime,
}
}

Expand Down Expand Up @@ -240,19 +233,6 @@ impl<M: MessageQueue> fmt::Debug for Namespace<M> {
}
}

impl<M: MessageQueue> Drop for Namespace<M> {
fn drop(&mut self) {
self.bg_runtime.block_on(async {
if let Err(e) = self.close().await {
error!(
"Close namespace failed, namespace:{}, err:{}",
self.inner.namespace, e
);
}
})
}
}

struct NamespaceInner<M: MessageQueue> {
namespace: String,
regions: Arc<RwLock<HashMap<RegionId, RegionRef<M>>>>,
Expand Down