Skip to content

Commit

Permalink
Feature 941 (#1072)
Browse files Browse the repository at this point in the history
### Feature or Bugfix
- Feature

### Detail
Share requests running in parallel override one another.

### Relates
- #941

### Testing
- 2 simultaneous shares got processed successfully with locking
mechanism.
- Here is what the dataset_lock DB looks like and the values in it.
<img width="1386" alt="Screenshot 2024-02-14 at 5 12 54 PM"
src="https://github.com/data-dot-all/dataall/assets/26413731/9e36044f-4f3d-4371-a6f2-7dee399da7a7">
- acquiredBy column show the share which last acquired the lock for the
particular dataset


### Security
Please answer the questions below briefly where applicable, or write
`N/A`. Based on
[OWASP 10](https://owasp.org/Top10/en/).

- Does this PR introduce or modify any input fields or queries - this
includes
fetching data from storage outside the application (e.g. a database, an
S3 bucket)?
  - Is the input sanitized?
- What precautions are you taking before deserializing the data you
consume?
  - Is injection prevented by parametrizing queries?
  - Have you ensured no `eval` or similar functions are used?
- Does this PR introduce any functionality or component that requires
authorization?
- How have you ensured it respects the existing AuthN/AuthZ mechanisms?
  - Are you logging failed auth attempts?
- Are you using or adding any cryptographic features?
  - Do you use a standard proven implementations?
  - Are the used keys controlled by the customer? Where are they stored?
- Are you introducing any new policies/roles/users?
  - Have you used the least-privilege principle? How?


By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Noah Paige <69586985+noah-paige@users.noreply.github.com>
Co-authored-by: dlpzx <71252798+dlpzx@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jaidisido <jaidisido@gmail.com>
Co-authored-by: dlpzx <dlpzx@amazon.com>
Co-authored-by: mourya-33 <134511711+mourya-33@users.noreply.github.com>
Co-authored-by: nikpodsh <124577300+nikpodsh@users.noreply.github.com>
Co-authored-by: MK <manjula_kasturi@hotmail.com>
Co-authored-by: Manjula <manjula.kasturi@gmail.com>
Co-authored-by: Zilvinas Saltys <zilvinas.saltys@gmail.com>
Co-authored-by: Zilvinas Saltys <zilvinas.saltys@yahooinc.com>
Co-authored-by: Daniel Lorch <98748454+lorchda@users.noreply.github.com>
Co-authored-by: Anushka Singh <anushka.singh@yahooinc.com>
Co-authored-by: Tejas Rajopadhye <71188245+TejasRGitHub@users.noreply.github.com>
Co-authored-by: trajopadhye <tejas.rajopadhye@yahooinc.com>
  • Loading branch information
16 people authored Feb 28, 2024
1 parent 179fbbb commit 7aef3ad
Show file tree
Hide file tree
Showing 5 changed files with 554 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ def __init__(self, state):
]
}
),
ShareObjectActions.AcquireLockFailure.value: Transition(
name=ShareObjectActions.AcquireLockFailure.value,
transitions={
ShareObjectStatus.Processed.value: [
ShareObjectStatus.Share_In_Progress.value,
ShareObjectStatus.Revoke_In_Progress.value
]
}
),
}

def run_transition(self, transition):
Expand Down Expand Up @@ -258,6 +267,13 @@ def __init__(self, state):
ShareItemStatus.Revoke_Succeeded.value
]
}
),
ShareObjectActions.AcquireLockFailure.value: Transition(
name=ShareObjectActions.AcquireLockFailure.value,
transitions={
ShareItemStatus.Share_Failed.value: [ShareItemStatus.Share_Approved.value],
ShareItemStatus.Revoke_Failed.value: [ShareItemStatus.Revoke_Approved.value],
}
)
}

Expand Down
Loading

0 comments on commit 7aef3ad

Please sign in to comment.