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: use pod name to get lock if hashVal is nil #1148

Merged
merged 5 commits into from
Oct 21, 2024

Conversation

zwwhdls
Copy link
Member

@zwwhdls zwwhdls commented Oct 18, 2024

fix #1147

@zwwhdls zwwhdls marked this pull request as ready for review October 21, 2024 03:41
Signed-off-by: zwwhdls <[email protected]>
@SonglinLife
Copy link

Perhaps the StopFd should include additional code to handle an empty hashVal. If hashVal is an empty string, StopFd will remove the fs.basePath.

func (fs *Fds) StopFd(ctx context.Context, podHashVal string) {
fs.globalMu.Lock()
f := fs.fds[podHashVal]
if f == nil {
serverParentPath := path.Join(fs.basePath, podHashVal)
_ = util.DoWithTimeout(ctx, 2*time.Second, func() error {
_, err := os.Stat(serverParentPath)
if err == nil {
_ = os.RemoveAll(serverParentPath)

@zwwhdls zwwhdls requested a review from zxh326 October 21, 2024 06:45
@zwwhdls zwwhdls merged commit 26da478 into master Oct 21, 2024
23 checks passed
@zwwhdls zwwhdls deleted the fix/mountpod-nohashlabel branch October 21, 2024 07:34
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] csi v0.25.0 can not manage exist mount pod which has no hashval annotation
3 participants