Skip to content

Conversation

@itslenny
Copy link
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

There is a potential race condition in the S3 locker that can cause zombie locks to be created if the lock is unlocked during the renewal operation (Between get and put)

What is the new behavior?

Check that the lock is still locked after the S3 get operation completes and exit if it was already unlocked

Additional context

This issue was causing intermittent test failures which would manifest in the "double unlock" test but was actually caused by the abort test leaving behind zombie objects. Running the S3 locker tests in a loop I was able to reproduce this semi-consistently. Usually it would take only a few test runs, but sometimes it'd go upwards of 50 runs without a failure.

The newly added test expands on the "handle abort signal" test and consistently fails without this fix.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 20110090962

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 75.96%

Totals Coverage Status
Change from base Build 20069848970: 0.03%
Covered Lines: 25433
Relevant Lines: 33205

💛 - Coveralls

}

async renewLock(id: string): Promise<boolean> {
async renewLock(id: string, checkLocked: () => boolean): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason why we need to pass a function a not check directly this.isLocked?

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.

4 participants