Skip to content

Commit

Permalink
fix notify deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
kostasrim committed Nov 11, 2024
1 parent ef6fa2c commit b1254f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/server/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class LocalBlockingCounter {
DCHECK(mutating_ > 0);
--mutating_;
if (mutating_ == 0) {
cond_var_.notify_one();
cond_var_.notify_all();
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/server/db_slice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1132,11 +1132,6 @@ DbSlice::PrimeItAndExp DbSlice::ExpireIfNeeded(const Context& cntx, PrimeIterato
<< ", prime table size: " << db->prime.size() << util::fb2::GetStacktrace();
}

// Replicate expiry
if (auto journal = owner_->journal(); journal) {
RecordExpiry(cntx.db_index, key);
}

if (expired_keys_events_recording_)
db->expired_keys_events_.emplace_back(key);

Expand All @@ -1148,6 +1143,11 @@ DbSlice::PrimeItAndExp DbSlice::ExpireIfNeeded(const Context& cntx, PrimeIterato
const_cast<DbSlice*>(this)->PerformDeletion(Iterator(it, StringOrView::FromView(key)),
ExpIterator(expire_it, StringOrView::FromView(key)),
db.get());
// Replicate expiry
if (auto journal = owner_->journal(); journal) {
RecordExpiry(cntx.db_index, key);
}

++events_.expired_keys;

return {PrimeIterator{}, ExpireIterator{}};
Expand Down

0 comments on commit b1254f6

Please sign in to comment.