1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

Fix deadlock issue with run: once (#1025)

This commit is contained in:
Bevan Arps
2023-03-02 13:53:38 +13:00
committed by GitHub
parent 97dcbe6932
commit 52756ab83e

View File

@@ -342,11 +342,15 @@ func (e *Executor) startExecution(ctx context.Context, t *taskfile.Task, execute
}
e.executionHashesMutex.Lock()
otherExecutionCtx, ok := e.executionHashes[h]
if ok {
if otherExecutionCtx, ok := e.executionHashes[h]; ok {
e.executionHashesMutex.Unlock()
e.Logger.VerboseErrf(logger.Magenta, "task: skipping execution of task: %s", h)
// Release our execution slot to avoid blocking other tasks while we wait
reacquire := e.releaseConcurrencyLimit()
defer reacquire()
<-otherExecutionCtx.Done()
return nil
}