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

APPEALS-24987 #18952

Merged
merged 9 commits into from
Jul 13, 2023
Merged

APPEALS-24987 #18952

merged 9 commits into from
Jul 13, 2023

Conversation

jtsangVA
Copy link
Contributor

@jtsangVA jtsangVA commented Jul 6, 2023

Resolves https://jira.devops.va.gov/browse/APPEALS-24987

Description

  • installed redis-mutex gem (https://github.com/kenn/redis-mutex)
  • Wrapped the sync! method in EndProductEstablishment into a critical section so that only one method can run at any given time. This is to prevent deadlock scenarios.

Acceptance Criteria

  • Code compiles correctly
  • When a EPE is being synced, all other jobs/processed that try to call sync! on that EPE has to wait until the first sync is finished and the lock released before the next sync method will execute.

Testing Plan

  1. (https://jira.devops.va.gov/browse/APPEALS-25425)

@jtsangVA jtsangVA changed the base branch from master to feature/APPEALS-21351 July 6, 2023 16:29
@codeclimate
Copy link

codeclimate bot commented Jul 6, 2023

Code Climate has analyzed commit 4f4ee14 and detected 45 issues on this pull request.

Here's the issue category breakdown:

Category Count
Security 1
Complexity 10
Style 34

View more on Code Climate.

@jtsangVA jtsangVA marked this pull request as ready for review July 13, 2023 14:48
@jtsangVA jtsangVA requested a review from AKeyframe July 13, 2023 15:49
Copy link
Contributor

@AKeyframe AKeyframe left a comment

Choose a reason for hiding this comment

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

Maybe add a comment about what auto_mutex does. Other than that looks good.
EDIT: Found the comment nvm. Looks good.

@jtsangVA jtsangVA merged commit 1886f66 into feature/APPEALS-21351 Jul 13, 2023
11 of 14 checks passed
@jtsangVA jtsangVA deleted the Jonathan/APPEALS-24987 branch July 13, 2023 16:01
@jtsangVA jtsangVA restored the Jonathan/APPEALS-24987 branch July 13, 2023 20:25
Aaron-Willis pushed a commit that referenced this pull request Aug 28, 2023
* APPEALS-24987 Added redis-mutex to gemfile

* APPEALS-24987 added RedisMutex init and lock

* removed "on" lock in EPE

* added comments, retrying lock using "id"

* removing lock on "id"

* deleting extra line

* saving progress

* removing debugging lines

---------

Co-authored-by: Jonathan Tsang <tsang_jonathan@bah.com>
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.

2 participants