Skip to content

Commit

Permalink
fix context early cancelation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoandredinis authored and github-actions committed Oct 16, 2024
1 parent 3852e32 commit be72ee1
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 be72ee1

Please sign in to comment.