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

feat: allow disabling global distributed locker per job #811

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

seinshah
Copy link
Contributor

@seinshah seinshah commented Jan 3, 2025

What does this do?

These changes allow us to disable the globally set distributed locker for a specific job, allowing those scheduled jobs to potentially run multiple times at once by different schedulers.

Which issue(s) does this PR fix/relate to?

Resolves #808

List any changes that modify/break current functionality

A new job option has been introduced to remove any potential breaking changes. Suppose we use the existing WithDistributedJobLocker method and treat its nil argument as an act of disabling the global locker for the job. In that case, the method won't return an error anymore; therefore, ErrWithDistributedJobLockerNil will be unused.

Have you included tests for your changes?

Yes, a new test case has been added to the distributed locker table test to check whether disabling the job locker while global locker is set works as expected.

Did you document any new/modified functionality?

  • Updated example_test.go (didn't need to)
  • Updated README.md (didn't need to)
  • Added method documentation block
  • Updated WithDistributedLocker method documentation to mention this feature

Notes

  • A new job option instead of tweaking the existing job option to avoid potential breaking changes
  • Tweaking distributed locker table test format to accommodate the new option for disabling it per job

@seinshah seinshah force-pushed the feat/disable_dist_locker branch from 14f6b74 to 79bf6c8 Compare January 3, 2025 18:32
@JohnRoesler JohnRoesler merged commit f5a5a2d into go-co-op:v2 Jan 3, 2025
4 checks passed
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.

[FEATURE] - Allow Disabling Global Locker At Job Level
2 participants