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

fix: Fix race condition in resolve #643

Merged
merged 1 commit into from
Feb 1, 2022
Merged

Conversation

bstasyszyn
Copy link
Contributor

Fixes a race condition which may occur when published operations are first retrieved, not found, and then unpublished operations are deleted before they are retrieved. In this case the DID resolve results in a 404 "not found" error.

This commit reverses the order of retrieval, i.e. first retrieve the unpublished operations and then the published ones.

closes #642

Signed-off-by: Bob Stasyszyn Bob.Stasyszyn@securekey.com

Fixes a race condition which may occur when published operations are first retrieved, not found, and then unpublished operations are deleted before they are retrieved. In this case the DID resolve results in a 404 "not found" error.

This commit reverses the order of retrieval, i.e. first retrieve the unpublished operations and then the published ones.

closes trustbloc#642

Signed-off-by: Bob Stasyszyn <Bob.Stasyszyn@securekey.com>
@codecov
Copy link

codecov bot commented Feb 1, 2022

Codecov Report

Merging #643 (54e8cdc) into main (7590707) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #643   +/-   ##
=======================================
  Coverage   93.63%   93.63%           
=======================================
  Files          75       75           
  Lines        4102     4102           
=======================================
  Hits         3841     3841           
  Misses        146      146           
  Partials      115      115           
Impacted Files Coverage Δ
pkg/processor/processor.go 95.21% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7590707...54e8cdc. Read the comment docs.

@fqutishat fqutishat merged commit 9cef7f4 into trustbloc:main Feb 1, 2022
@bstasyszyn bstasyszyn deleted the 642 branch June 30, 2022 15:13
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.

Potential race condition with unpublished operations
2 participants