Skip to content

Conversation

@lingrino
Copy link
Contributor

@lingrino lingrino commented May 3, 2022

This PR rewrites lock-exec. The big changes are removing the dynamolock package, upgrading to aws-sdk-v2, and using actions for validation and releases. Big list of changes:

  • Upgrade to go 1.18
  • Publish to github docker registry, ghcr.io
  • Replace circleci with github actions
  • dependabot for upgrading packages
  • strict golangci-lint
  • replace logrus (deprecated) with zap
  • support context.Context and cancellation everywhere
  • support unlocking when cancelled with os.Interrupt
  • move flags to arguments (table name and command)
  • keep all logging in cmd package
  • sync lock package with loomctl lock package
  • update to aws-sdk-v2
  • remove dynamolock package
  • remove random sleep and unlock delay, which should be unnecessary with dynamodb conditions

There are many small breaking changes in this PR but the big change is that we've removed our dependency on the dynamolock package in favor of using native dynamodb. This block of code uses dynamodb conditional expressions to support long-term locks without any third party package. The dynamolock package is intended for high-frequency in-process locking whereas this tool is intended for low-frequency out-of-process locking so we don't need any of the heartbeats and other things that dynamolock adds for us.

There are many things that could be improved (list below) but overall this PR should improve on the current situation and set us up for new contributions in the future! I don't think I've removed any functionality. Some things that could be improved in the future:

  • Support direct/custom aws authentication
  • Support timeout flag using existing context
  • Support custom lock duration, currently 24 hours if lock fails

cc @shayonj @hspak hello 👋 !

@lingrino lingrino requested a review from a team as a code owner May 3, 2022 06:44
@lingrino lingrino merged commit bb44af5 into main May 4, 2022
@lingrino lingrino deleted the lingrino/v2 branch May 4, 2022 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants