Skip to content

Commit

Permalink
Feature 941 (data-dot-all#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
- data-dot-all#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] <[email protected]>
Co-authored-by: Noah Paige <[email protected]>
Co-authored-by: dlpzx <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jaidisido <[email protected]>
Co-authored-by: dlpzx <[email protected]>
Co-authored-by: mourya-33 <[email protected]>
Co-authored-by: nikpodsh <[email protected]>
Co-authored-by: MK <[email protected]>
Co-authored-by: Manjula <[email protected]>
Co-authored-by: Zilvinas Saltys <[email protected]>
Co-authored-by: Zilvinas Saltys <[email protected]>
Co-authored-by: Daniel Lorch <[email protected]>
Co-authored-by: Anushka Singh <[email protected]>
Co-authored-by: Tejas Rajopadhye <[email protected]>
Co-authored-by: trajopadhye <[email protected]>
  • 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.