Skip to content

Commit

Permalink
Update src/storage/src/hummock/utils.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Croxx <[email protected]>
  • Loading branch information
Little-Wallace and MrCroxx authored May 14, 2024
1 parent e33824f commit 57d2a3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/storage/src/hummock/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ pub struct PendingRequestCancelGuard {
impl Drop for PendingRequestCancelGuard {
fn drop(&mut self) {
if let Some(limiter) = self.inner.take() {
// close rc before calling `try_recv`, it will make `MemoryTrackerImpl` which generates after dropping of `PendingRequestCancelGuard` drop in loop of `may_notify_waiters` in other thread.
// close rx before calling `try_recv`, it will make `MemoryTrackerImpl` which generates after dropping of `PendingRequestCancelGuard` drop in loop of `may_notify_waiters` in other thread.
// If `MemoryTrackerImpl` send before this thread calling `close`, it can still be received by this thread. Once this thread receives the message, it need drop the message and update `total_size` in `MemoryTrackerImpl`'s drop.
self.rx.close();
if let Ok(msg) = self.rx.try_recv() {
Expand Down

0 comments on commit 57d2a3f

Please sign in to comment.