Skip to content

Commit

Permalink
fix: [2.5] Release lock when return function (#38863)
Browse files Browse the repository at this point in the history
issue: #38851 

master pr: #38856

Signed-off-by: Cai Zhang <[email protected]>
  • Loading branch information
xiaocai2333 authored Dec 30, 2024
1 parent 015e50e commit 71dea30
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions internal/datacoord/compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,18 @@ func (c *compactionPlanHandler) schedule() []CompactionTask {
slots map[int64]int64
)

c.executingGuard.Lock()
if len(c.executingTasks) >= parallelism {
return selected
}
c.executingGuard.Unlock()

l0ChannelExcludes := typeutil.NewSet[string]()
mixChannelExcludes := typeutil.NewSet[string]()
clusterChannelExcludes := typeutil.NewSet[string]()
mixLabelExcludes := typeutil.NewSet[string]()
clusterLabelExcludes := typeutil.NewSet[string]()

c.executingGuard.RLock()
if len(c.executingTasks) >= parallelism {
c.executingGuard.RUnlock()
return selected
}

for _, t := range c.executingTasks {
switch t.GetTaskProto().GetType() {
case datapb.CompactionType_Level0DeleteCompaction:
Expand Down

0 comments on commit 71dea30

Please sign in to comment.