clearhaus / clearhaus/dynamodb-mutex

Be independent on system time

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
icebox
Dominant language
Ruby
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading lib/dynamodb_mutex/lock.rb at the :created timestamp reference and trace how :ttl is used when acquiring and checking a lock. Define how instances should recognize a lock without relying on synchronized system time, then document the resulting :ttl or :min_ttl behavior. The issue does not mention tests to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.