diff --git a/component/file_cache/file_cache.go b/component/file_cache/file_cache.go index 77a854b96..9c1656f93 100644 --- a/component/file_cache/file_cache.go +++ b/component/file_cache/file_cache.go @@ -1328,11 +1328,7 @@ func (fc *FileCache) GetAttr(options internal.GetAttrOptions) (*internal.ObjAttr // To cover cases 2 and 3, grab the attributes from the local cache localPath := filepath.Join(fc.tmpPath, options.Name) - flock := fc.fileLocks.Get(options.Name) - // TODO: should we use a RWMutex and use RLock for stat calls? - flock.Lock() info, err := os.Stat(localPath) - flock.Unlock() // All directory operations are guaranteed to be synced with storage so they cannot be in a case 2 or 3 state. if err == nil && !info.IsDir() { if exists { // Case 3 (file in cloud storage and in local cache) so update the relevant attributes diff --git a/component/file_cache/file_cache_test.go b/component/file_cache/file_cache_test.go index 4fad7a792..f0b31fa41 100644 --- a/component/file_cache/file_cache_test.go +++ b/component/file_cache/file_cache_test.go @@ -1188,12 +1188,7 @@ func (suite *fileCacheTestSuite) TestGetAttrCase3() { suite.assert.NoError(err) suite.assert.NotNil(attr) suite.assert.EqualValues(file, attr.Path) - // this check is flaky in our CI pipeline on Linux, so skip it - if runtime.GOOS != "windows" { - fmt.Println("Skipping TestGetAttrCase3 attr.Size check on Linux because it's flaky.") - } else { - suite.assert.EqualValues(1024, attr.Size) - } + suite.assert.EqualValues(1024, attr.Size) } func (suite *fileCacheTestSuite) TestGetAttrCase4() {