Skip to content

Commit

Permalink
Fix the potential data race with RWLock
Browse files Browse the repository at this point in the history
Signed-off-by: kerthcet <[email protected]>
  • Loading branch information
kerthcet authored and tekton-robot committed May 20, 2022
1 parent 3a305a0 commit 4a93b62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/pipelinerunmetrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (r *Recorder) DurationAndCount(pr *v1beta1.PipelineRun) error {
// returns an error if its failed to log the metrics
func (r *Recorder) RunningPipelineRuns(lister listers.PipelineRunLister) error {
r.mutex.Lock()
r.mutex.Unlock()
defer r.mutex.Unlock()

if !r.initialized {
return errors.New("ignoring the metrics recording, failed to initialize the metrics recorder")
Expand Down

0 comments on commit 4a93b62

Please sign in to comment.