Skip to content

Commit

Permalink
fix locks in pipeline state set (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
ukclivecox authored Apr 22, 2022
1 parent 5d30332 commit 248b377
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scheduler/pkg/store/pipeline/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ func (ps *PipelineStore) terminateOldUnterminatedPipelinesIfNeeded(pipeline *Pip
}

func (ps *PipelineStore) SetPipelineState(name string, versionNumber uint32, uid string, status PipelineStatus, reason string) error {
ps.mu.RLock()
defer ps.mu.RUnlock()
ps.mu.Lock()
defer ps.mu.Unlock()
if pipeline, ok := ps.pipelines[name]; ok {
if pipelineVersion := pipeline.GetPipelineVersion(versionNumber); pipelineVersion != nil {
if pipelineVersion.UID == uid {
Expand Down

0 comments on commit 248b377

Please sign in to comment.