Skip to content

Commit

Permalink
[Bug] Fix CompactionPermitLimiter cv starve bug (#5274)
Browse files Browse the repository at this point in the history
Fix _permits_cv.wait maybe starve to death bug.
  • Loading branch information
acelyc111 authored Jan 31, 2021
1 parent b315244 commit 2d70cc5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions be/src/olap/compaction_permit_limiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ bool CompactionPermitLimiter::request(int64_t permits) {
}

void CompactionPermitLimiter::release(int64_t permits) {
std::unique_lock<std::mutex> lock(_permits_mutex);
_used_permits -= permits;
_permits_cv.notify_one();
DorisMetrics::instance()->compaction_used_permits->set_value(_used_permits);
Expand Down

0 comments on commit 2d70cc5

Please sign in to comment.