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

UmountFs will cause deadlock #2308

Closed
surpassly opened this issue Mar 14, 2023 · 8 comments
Closed

UmountFs will cause deadlock #2308

surpassly opened this issue Mar 14, 2023 · 8 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@surpassly
Copy link

Describe the bug (描述bug)
UmountFs will cause deadlock

To Reproduce (复现方法)
Deadlock happens in this circumstances.
A and B are different mount points of same Fs.

  1. A acquires NameLockGuard in UmountFs
  2. B acquires WriteLockGuard in UpdateClientAliveTime
  3. B acquires NameLockGuard in AddMountPoint
  4. A acquires WriteLockGuard in DeleteClientAliveTime

Expected behavior (期望行为)

Versions (各种版本)
OS:
Compiler:
branch:
commit id:

Additional context/screenshots (更多上下文/截图)

@surpassly surpassly added the bug Something isn't working label Mar 14, 2023
@wuhongsong
Copy link
Contributor

@surpassly thanks for you contribution. @SeanHai have a look?

@surpassly
Copy link
Author

surpassly commented Apr 10, 2023 via email

@zhanghuidinah
Copy link
Member

@liuxy028
Copy link

Hello, I want to solve this porblem!

@liuxy028
Copy link

liuxy028 commented Apr 21, 2023 via email

@caoxianfei1 caoxianfei1 added the good first issue Good for newcomers label Apr 27, 2023
@liuxy028 liuxy028 removed their assignment Apr 27, 2023
@liuxy028
Copy link

liuxy028 commented Apr 27, 2023 via email

@Xinlong-Chen
Copy link
Contributor

I don't find the code about add NameLockGuard in AddMountPoint.

FSStatusCode FsManager::AddMountPoint(const Mountpoint& mountpoint,
const std::string& fsName) {
LOG(INFO) << "AddMountPoint mountpoint = " << mountpoint.DebugString()
<< ", fsName = " << fsName;
// 1. query fs
FsInfoWrapper wrapper;
FSStatusCode ret = fsStorage_->Get(fsName, &wrapper);
if (ret != FSStatusCode::OK) {
LOG(WARNING) << "AddMountPoint fail, get fs fail, fsName = " << fsName
<< ", errCode = " << FSStatusCode_Name(ret);
return ret;
}
// 2. insert mountpoint
wrapper.AddMountPoint(mountpoint);
// for persistence consider
ret = fsStorage_->Update(wrapper);
if (ret != FSStatusCode::OK) {
LOG(WARNING) << "AddMountPoint update fs fail, fsName = " << fsName
<< ", mountpoint = " << mountpoint.ShortDebugString()
<< ", errCode = " << FSStatusCode_Name(ret);
return ret;
}
return FSStatusCode::OK;
}

Has the bug been fixed?

@surpassly
Copy link
Author

surpassly commented Jun 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants