Skip to content

fix: fix concurrency bugs causing panics and race conditions in internal/syncutil#921

Merged
Wwwsylvia merged 13 commits into
oras-project:mainfrom
Wwwsylvia:fix_syncutil
Mar 19, 2025
Merged

fix: fix concurrency bugs causing panics and race conditions in internal/syncutil#921
Wwwsylvia merged 13 commits into
oras-project:mainfrom
Wwwsylvia:fix_syncutil

Conversation

@Wwwsylvia

@Wwwsylvia Wwwsylvia commented Mar 17, 2025

Copy link
Copy Markdown
Member
  1. Remove the use of atomic.Value
  2. Cancel all go-routines before releasing semaphore permits
  3. Wait for schedule go-routines to release the semaphore permits before returning
  4. Add unit tests

Fixes #916, fixes #908

Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
@codecov

codecov Bot commented Mar 17, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.98%. Comparing base (fdf2c51) to head (26ee98a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #921      +/-   ##
==========================================
+ Coverage   80.24%   80.98%   +0.74%     
==========================================
  Files          63       63              
  Lines        6053     6063      +10     
==========================================
+ Hits         4857     4910      +53     
+ Misses        858      811      -47     
- Partials      338      342       +4     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Wwwsylvia

Wwwsylvia commented Mar 17, 2025

Copy link
Copy Markdown
Member Author

Mmmm the missing lines are tricky to cover

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the code coverage, let's discuss offline.

Comment thread internal/syncutil/limit.go Outdated
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

Incorrect use of atomic.Value in the syncutil.Go utility function causes panic Flaky unit test: TestCopyGraph_WithOptions/MountFrom_error

2 participants