-
Notifications
You must be signed in to change notification settings - Fork 997
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 warning log when creating a new cache dir #5200
Conversation
Signed-off-by: Changxin Miao <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5200 +/- ##
===========================================
- Coverage 54.27% 43.94% -10.33%
===========================================
Files 161 104 -57
Lines 43776 19341 -24435
===========================================
- Hits 23758 8500 -15258
+ Misses 17336 10066 -7270
+ Partials 2682 775 -1907
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
we should ignore the EEXISTS from Mkdir, it's an expected behavior |
Signed-off-by: jiefenghuang <[email protected]>
f102a71
to
89fcbd9
Compare
We have os.Stat check in the beginning, and only create if os.Stat says it doesn't exist. So I suppose the EEXISTS error is a unexpected behavior? |
It's expected that more than one goroutine will call createDir(), so one fail with EEXISTS is expected. |
OK, get it - it has concurrent access when writing caches. |
Signed-off-by: Changxin Miao <[email protected]>
Signed-off-by: Changxin Miao <[email protected]> Signed-off-by: jiefenghuang <[email protected]> Co-authored-by: jiefenghuang <[email protected]>
After updating to the latest master branch, a lot of warning logs show up (see attached screenshot).
This happens because
dir
is appended with "/" in the CacheManager (I don't know why), and when callingfilepath.Dir
on a string ending with "/", the function returns the same dir (with "/" trimed). So same dir is passed toos.Mkdir
twice, and the second call will raise a warning log. This may cause confusion to users.