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 race condition with async API operations #1377

Closed

Conversation

neolynx
Copy link
Member

@neolynx neolynx commented Oct 21, 2024

Fixes #1376

Description of the Change

  • fix race condition with rasync background operations
  • Do all relevant database reading inside maybeRunTaskInBackground.
  • Notably, LoadComplete will load the reflist of a repo. if this is done outside of a background operation, the data might be outdated when the background tasks runs.

@neolynx neolynx force-pushed the fix/concurrent-repo-add branch 4 times, most recently from d813fef to 309450d Compare October 21, 2024 18:38
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 51.53846% with 63 lines in your changes missing coverage. Please review.

Please upload report for BASE (feature/allow_component_management@a771707). Learn more about missing BASE report.

Files with missing lines Patch % Lines
api/publish.go 60.22% 24 Missing and 11 partials ⚠️
api/snapshot.go 28.57% 10 Missing and 5 partials ⚠️
api/repos.go 40.00% 8 Missing and 4 partials ⚠️
deb/publish.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                          @@
##             feature/allow_component_management    #1377   +/-   ##
=====================================================================
  Coverage                                      ?   74.91%           
=====================================================================
  Files                                         ?      156           
  Lines                                         ?    17970           
  Branches                                      ?        0           
=====================================================================
  Hits                                          ?    13462           
  Misses                                        ?     3419           
  Partials                                      ?     1089           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@neolynx neolynx changed the base branch from master to feature/allow_component_management October 21, 2024 19:21
@neolynx neolynx self-assigned this Oct 21, 2024
@neolynx neolynx requested a review from a team October 21, 2024 19:41
@neolynx neolynx added the needs review Ready for review & merge label Oct 21, 2024
@neolynx neolynx changed the title Fix/concurrent repo add Fix race condition with async API operations Oct 21, 2024
aol-nnov and others added 20 commits October 22, 2024 07:53
To achieve feature parity with cli, it is now possible
to create repos from snapshots
Update create repo API to support snapshots
This commit allows to add, remove and update components of published repositories without the need to recreate them.

Signed-off-by: Christoph Fiehe <[email protected]>
Signed-off-by: Christoph Fiehe <[email protected]>
Signed-off-by: Christoph Fiehe <[email protected]>
Signed-off-by: Christoph Fiehe <[email protected]>
Signed-off-by: Christoph Fiehe <[email protected]>
Signed-off-by: Christoph Fiehe <[email protected]>
Signed-off-by: Christoph Fiehe <[email protected]>
neolynx and others added 11 commits October 22, 2024 11:48
Signed-off-by: Christoph Fiehe <[email protected]>
Do all relevant database reading/modifying inside `maybeRunTaskInBackground`.

Notably, `LoadComplete` will load the reflist of a repo. if this is done outside of a background operation,
the data might be outdated when the background tasks runs.
@neolynx neolynx force-pushed the fix/concurrent-repo-add branch from 309450d to 92eebba Compare October 22, 2024 09:50
@neolynx neolynx deleted the branch feature/allow_component_management October 22, 2024 09:51
@neolynx neolynx closed this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Ready for review & merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lost packages after publication
2 participants