Skip to content

Commit

Permalink
dynamolock/v2: grab lock semaphore to prevent competing operations be…
Browse files Browse the repository at this point in the history
…tween monitor and heartbeats

Closes #184
  • Loading branch information
ucirello committed Mar 23, 2023
1 parent d4a93eb commit 9b891ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions v2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,9 @@ func (c *Client) lockSessionMonitorChecker(ctx context.Context,
case <-ctx.Done():
return
default:
lock.semaphore.Lock()
timeUntilDangerZone, err := lock.timeUntilDangerZoneEntered()
lock.semaphore.Unlock()
if err != nil {
c.logger.Println(ctx, "cannot run session monitor because", err)
return
Expand Down

0 comments on commit 9b891ec

Please sign in to comment.