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: gc works unexpeted in high concurrent #175

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

Desiki-high
Copy link
Collaborator

To resolve the concurrent race issue, now gc will wait for all converting tasks completed.

resolve #174.

Copy link
Collaborator

@imeoer imeoer left a comment

Choose a reason for hiding this comment

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

Can we add a metux lock between GC and Convert to simply the GC race?

@Desiki-high
Copy link
Collaborator Author

Can we add a metux lock between GC and Convert to simply the GC race?

We can try RWMutex.

When acceld converts multiple images with large size differences, for example : alpine and WordPress.
Obviously alpine will finish the task first, and WordPress is still in the pulling phase.
If alpine triggers gc(decide by configuration), GC will clear the blobs of WordPress,
because the lease of WordPress blob had cached in lease and only used once(in commit).
To solve this problem, now gc will wait all converting tasks completed.

fix goharbor#174

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
@imeoer imeoer merged commit 7402434 into goharbor:main Aug 24, 2023
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.

bug: gc clear blobs unexpeted
2 participants