Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve failover mechanism #386

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Commits on Nov 14, 2024

  1. set log level of some messages to info to have more visibility of the…

    … errors; improve log messages and code comments (NO LOGIC CHANGES)
    stefan.rieckhof committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    ead7df2 View commit details
    Browse the repository at this point in the history
  2. try refreshing lock TTL well before TTL expiration

    stefan.rieckhof committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    c3c2435 View commit details
    Browse the repository at this point in the history
  3. adjust the retry strategy for more sanity when trying to obtain the l…

    …ock by a passive/undefined pod
    stefan.rieckhof committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    72f31af View commit details
    Browse the repository at this point in the history
  4. try immediate lock reacquisition if lock refresh failed

    stefan.rieckhof committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    995a3fe View commit details
    Browse the repository at this point in the history
  5. add retry backoff to locker.Obtain() to avoid a retry loop; rename va…

    …riable
    stefan.rieckhof committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    da7b3a3 View commit details
    Browse the repository at this point in the history
  6. add nil check before trying to refresh a lock

    stefan.rieckhof committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    a8c6a30 View commit details
    Browse the repository at this point in the history
  7. rename ticker t to refresh

    stefan.rieckhof committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    80ff4b2 View commit details
    Browse the repository at this point in the history
  8. improvements for readability

    stefan.rieckhof committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    8ecf3e0 View commit details
    Browse the repository at this point in the history
  9. improve backoff interval and comment

    stefan.rieckhof committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    06c105a View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2024

  1. improve/add comments; implement safeguard when lock.TTL() returns an …

    …error
    stefan.rieckhof committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    10aecd4 View commit details
    Browse the repository at this point in the history
  2. decrease log level for most logs to debug; enforce minimum refresh ti…

    …me after lock acquisition
    stefan.rieckhof committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    3b13d0a View commit details
    Browse the repository at this point in the history
  3. DEBUG: add Stefan to log messages for testing

    stefan.rieckhof committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    a1eba4a View commit details
    Browse the repository at this point in the history
  4. replace *redislock.Client by an interface, that is, LockClient to all…

    …ow for dependency injection also with a mock redis lock client
    stefan.rieckhof committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    4ba1382 View commit details
    Browse the repository at this point in the history
  5. create mocks for redislock.Client and redislock.Lock

    stefan.rieckhof committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    a35d417 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2024

  1. remove m.Called() from Obtain()

    stefan.rieckhof committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    75e6f63 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2024

  1. add some more log lines

    stefan.rieckhof committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    419751c View commit details
    Browse the repository at this point in the history
  2. add some more log lines

    stefan.rieckhof committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    a033516 View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2024

  1. add some more log lines

    stefan.rieckhof committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    d9b2a29 View commit details
    Browse the repository at this point in the history
  2. add some more log lines

    stefan.rieckhof committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    7eef210 View commit details
    Browse the repository at this point in the history
  3. call lock.TTL() with a timeout context

    stefan.rieckhof committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    fc86408 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e2f8b1a View commit details
    Browse the repository at this point in the history
  5. delete lock and redislock mocks

    stefan.rieckhof committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    ac90f64 View commit details
    Browse the repository at this point in the history
  6. check for lock==nil before calling lock.TTL()

    stefan.rieckhof committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    7f0039e View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2024

  1. do lock operations only if Redis is reachable

    stefan.rieckhof committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    528e9e4 View commit details
    Browse the repository at this point in the history
  2. add check for lock key existence to prevent interface {} conversion e…

    …rror when trying to get the TTL from the lock
    stefan.rieckhof committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    333e931 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    20cf4bd View commit details
    Browse the repository at this point in the history