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 watchdog thread for umount may hang #5359

Closed
wants to merge 2 commits into from

Conversation

polyrabbit
Copy link
Contributor

We still observe unkillable juicefs processes in our environment, here is one scenario:

  1. doUmount call has finished, but it failed.
  2. watch dog thread for doUmount stucks in FlushAll.

The watch dog thread is used to monitor doUmount thread, but I think a reverse watch mechanism also needed.

image

@davies
Copy link
Contributor

davies commented Dec 10, 2024

The above lock is suspicious, have you find out the cause?

logger.Warnf("Umount failed: %s", err)
}
time.Sleep(time.Second * 30)
os.Exit(meta.UmountCode) // Just in case the above watchdog thread hangs
Copy link
Contributor

Choose a reason for hiding this comment

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

FlushAll may take long than 30 seconds, some data may lose if we exit before that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about only os.Exit when doUmount fails?

FlushAll only flushes memory buffers. Those are requests not acked to client, I suppose it's OK to drop them under abnormal conditions. Juicefs only promises a close-to-open consistency.

@polyrabbit
Copy link
Contributor Author

The above lock is suspicious, have you find out the cause?

I suppose it's because user sends too many write requests - there are more than 500 commitThread threads. User's process becomes unresponsive and unkillable ([rclone] <defunct>), so as the juicefs process. I suppose juicefs needs a way to protect itself from such a large write concurrency.

@polyrabbit polyrabbit closed this Dec 11, 2024
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.

2 participants