Skip to content

Be independent on system time #1

Open
@ct-clearhaus

Description

@ct-clearhaus

Time may differ on instances running, so the lock acquiring timeout may be different than what's configured if two systems sharing the lock has time drifting away from each other.

What about writing something "random" (collision resistant; just incremental?) rather than :created time (https://github.com/clearhaus/dynamodb-mutex/blob/master/lib/dynamodb_mutex/lock.rb#L36) and then each instance checks if it has seen the given "random" for :ttl time?

Then :ttl becomes kinda ":min_ttl", or the TTL that will always be experienced. Needs to be documented. It's also easy to document that you need time on instances to be right, but the bugs you may experience with time drifting is probable less fun than the configuration trouble you have when setting the TTL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions