Skip to content

Conversation

@eliotsykes
Copy link

Time.now is not a reliable way to measure elapsed time. If a system clock adjustment coincides with a lock being held, then the timeout actually used may not be the same as timeout_seconds.

The monotonic clock measures elapsed time more accurately. The monotonic time is the time since the computer started up, and it is always moving forward.

This change should only affect postgres advisory locks as mysql does not use this method for its timeout behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant