Closed Bug 918625 Opened 11 years ago Closed 11 years ago

Implement a distributed mutex for bug modifications

Categories

(Firefox OS Graveyard :: Gaia::GithubBot, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jhford, Assigned: jhford)

References

Details

Attachments

(1 file)

Updating bugs (i.e. more than just comments) requires two non-atomic API calls.  We need to fetch the bug to get the update token, then we post the new bug information.

We should have a shared mutex across the entire bot to ensure that no single bug is attempted to be worked on by two different api consumers.
Blocks: 918623
No longer depends on: 916906, 918623
Attached file pull request
This is a distributed lock.  It's safe to double-unlock something, but double locking will fail (obviously).

I'm not sure if I like how the redisOpts stuff works, also I think my unit tests would be better if I stubbed out redis instead of using a real redis.  I didn't do that because I couldn't figure out how to stub api methods without recreating a whole api object.
Attachment #811415 - Flags: review?(jlal)
Comment on attachment 811415 [details] [review]
pull request

with nits see github
Attachment #811415 - Flags: review?(jlal) → review+
Attachment mime type: text/plain → text/x-github-pull-request
https://github.com/mozilla-b2g-bot/shared-mutex/commit/e62dcf62b0b4d84b2c1f92e2726a519de6203b3c
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Assignee: nobody → jhford
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: