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 DeadLock in Kernel List Cache Feature #2100

Merged
merged 9 commits into from
Jul 9, 2024
Merged

Conversation

raj-prince
Copy link
Collaborator

@raj-prince raj-prince commented Jul 4, 2024

Description

When
It happens when two parallel calls OpenDir and LookUpInode comes for the same directory.

Why
When kernel-list-cache is enabled (means ttl > 0), we were not following Lock ordering for dirInode and fs. Ideally, we should acquire dirInode lock first, but it was opposite. Fixing the order solves the issue.

Link to the issue in case of a bug fix.

#2104

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - NA

Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.42%. Comparing base (43e4b64) to head (ceb292e).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2100      +/-   ##
==========================================
- Coverage   71.93%   70.42%   -1.51%     
==========================================
  Files         101      101              
  Lines       10996    11937     +941     
==========================================
+ Hits         7910     8407     +497     
- Misses       2758     3194     +436     
- Partials      328      336       +8     
Flag Coverage Δ
unittests 70.42% <100.00%> (-1.51%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@raj-prince raj-prince marked this pull request as ready for review July 4, 2024 09:36
@raj-prince raj-prince requested a review from a team as a code owner July 4, 2024 09:36
@raj-prince raj-prince requested a review from charith87 July 4, 2024 09:36
@raj-prince raj-prince changed the title Fix DeadLock in Kernel List Cache Fix DeadLock in Kernel List Cache Feature Jul 4, 2024
internal/fs/fs.go Outdated Show resolved Hide resolved
internal/fs/fs.go Outdated Show resolved Hide resolved
@raj-prince raj-prince merged commit db62303 into master Jul 9, 2024
13 checks passed
gargnitingoogle pushed a commit that referenced this pull request Jul 11, 2024
* Able to reproduce the hang

* Adding composite test for deadlock case

* Fixing lint issue

* reverting minor line deletion

* go import

* comment changes

* Review comments

* Liting fix

* Added more concurrent test
ashmeenkaur pushed a commit that referenced this pull request Jul 16, 2024
* Able to reproduce the hang

* Adding composite test for deadlock case

* Fixing lint issue

* reverting minor line deletion

* go import

* comment changes

* Review comments

* Liting fix

* Added more concurrent test
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.

5 participants