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

nydusd: fix race window in copen handler #623

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

kevinXYin
Copy link
Contributor

we should make sure blob cache init thread get wlock before user daemon
get first ondemand req.

Fixes: 82f6712 ("nydusd: make copen always return right file size")
Suggested-by: Jiang Liu [email protected]
Signed-off-by: Xin Yin [email protected]

@anolis-bot
Copy link
Collaborator

@kevinXYin , a new test job has been submitted. Please wait in patience. The test job url: None

@anolis-bot
Copy link
Collaborator

@kevinXYin , The CI test is completed, please check result:

Test CaseTest Result
merge-target-branch✅ SUCCESS
build-docker-image✅ SUCCESS
compile-nydus✅ SUCCESS
compile-ctr-remote✅ SUCCESS
compile-nydus-snapshotter✅ SUCCESS
start-nydus-snapshotter-config-containerd✅ SUCCESS
run-container-with-nydus-image✅ SUCCESS

Congratulations, your test job passed!

@changweige
Copy link
Contributor

Could you help elaborate further about the race window this PR is closing?

let barrier = Arc::new(Barrier::new(2));
Self::init_blobcache(fsblob, Arc::clone(&barrier));
// make sure blob cache init thread get wlock before get first ondemand req
barrier.wait();
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:
Some grammar mistakes with this comment sentence 😹

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed ~

If the blobcache init thread was not scheduled immediately after
creation, and an ondemand request arrived. The fscache handler may not
wait for blobcache to be created and resault in eio.

We should make sure the blobcache init thread gets wlock before user
daemon receives first ondemand request.

Fixes: 82f6712 ("nydusd: make copen always return right file size")
Suggested-by: Jiang Liu <[email protected]>
Signed-off-by: Xin Yin <[email protected]>
@anolis-bot
Copy link
Collaborator

@kevinXYin , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: None

@kevinXYin
Copy link
Contributor Author

Could you help elaborate further about the race window this PR is closing?

updated in commit message

@anolis-bot
Copy link
Collaborator

@kevinXYin , The CI test is completed, please check result:

Test CaseTest Result
merge-target-branch✅ SUCCESS
build-docker-image✅ SUCCESS
compile-nydus✅ SUCCESS
compile-ctr-remote✅ SUCCESS
compile-nydus-snapshotter✅ SUCCESS
start-nydus-snapshotter-config-containerd✅ SUCCESS
run-container-with-nydus-image✅ SUCCESS

Congratulations, your test job passed!

@jiangliu jiangliu merged commit 6d66c13 into dragonflyoss:master Aug 1, 2022
@kevinXYin kevinXYin deleted the init-blobcache-fix branch October 10, 2022 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants