Skip to content

Commit

Permalink
fix context early cancelation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoandredinis committed Oct 17, 2024
1 parent b5579b8 commit fd9536b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/srv/discovery/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ func (s *Server) acquireSemaphoreForUserTask(userTaskName string) (releaseFn fun

// Once the lease parent context is canceled, the lease will be released.
ctxWithLease, cancel := context.WithCancel(lease)
defer cancel()

releaseFn = func() {
cancel()
lease.Stop()
if err := lease.Wait(); err != nil {
s.Log.WithError(err).WithField("semaphore", userTaskName).Warn("error cleaning up UserTask semaphore")
Expand Down

0 comments on commit fd9536b

Please sign in to comment.