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

Hadoop: fix background task thread leak #5363

Merged
merged 11 commits into from
Dec 16, 2024
Merged

Hadoop: fix background task thread leak #5363

merged 11 commits into from
Dec 16, 2024

Conversation

tangyoupeng
Copy link
Contributor

@tangyoupeng tangyoupeng commented Dec 11, 2024

BgTaskUtil:
对于同一个 volname 的后台任务只会启动一个实例运行。BgTaskUtil 的 runningInstance 存储了每个 volname 和 handles 之间的映射,当同一个 volname 的所有实例全部关闭,即 BgTaskUtil 内 volname 没有任何 handle 时,清理该 volname 对应的所有后台任务。确保当所有 JuiceFileSystem instance 关闭时,没有线程泄漏。

juicefs.users 和 juicefs.groups 配置的全局 guid 映射会缓存在 main.go 的 userGroupCache // name -> (user -> groups) 里,每个实例 user 的 groups 会优先查询此 map,如果没有找到,才会使用 java 传入的 group。Java 端后台任务会定期更新
userGroupCache,默认 1 分钟一次

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.71%. Comparing base (a33d9bb) to head (b3d9d1e).
Report is 18 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5363       +/-   ##
===========================================
+ Coverage   35.05%   60.71%   +25.65%     
===========================================
  Files         129       29      -100     
  Lines       36040    18827    -17213     
===========================================
- Hits        12635    11431     -1204     
+ Misses      22150     5871    -16279     
- Partials     1255     1525      +270     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tangyoupeng tangyoupeng marked this pull request as ready for review December 16, 2024 08:28
@tangyoupeng tangyoupeng requested a review from davies December 16, 2024 08:28
@tangyoupeng tangyoupeng merged commit aee72ca into main Dec 16, 2024
40 checks passed
@tangyoupeng tangyoupeng deleted the refactor_bg_task branch December 16, 2024 09:14
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