Skip to content

s3: fix race conditions#1594

Merged
neolynx merged 1 commit into
masterfrom
fix/s3-race
Jun 19, 2026
Merged

s3: fix race conditions#1594
neolynx merged 1 commit into
masterfrom
fix/s3-race

Conversation

@neolynx

@neolynx neolynx commented Jun 19, 2026

Copy link
Copy Markdown
Member

Fixes: #1223

Description of the Change

Path Cache handling was already addressed in PR #1224 (which was not merged), #1241 (merged instead).

Make sure pathCache is properly locked for concurrent access.

Add RWMutex to the PublishedStorage struct and locked every access to pathCache.

  • Cache initialization
    Read-lock to test for nil, then write-lock with a second nil check before populating
  • Cache reads
    RLock/RUnlock, allowing concurrent readers
  • Cache writes / deletes
    Lock/Unlock

cc: @sf-nwaller

@neolynx neolynx self-assigned this Jun 19, 2026
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.14286% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.37%. Comparing base (c0c4bc3) to head (c633247).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
s3/public.go 80.76% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1594   +/-   ##
=======================================
  Coverage   77.37%   77.37%           
=======================================
  Files         165      165           
  Lines       15727    15747   +20     
=======================================
+ Hits        12168    12185   +17     
- Misses       2353     2356    +3     
  Partials     1206     1206           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Make sure pathCache is properly locked for concurrent access.

Add RWMutex to the PublishedStorage struct:
- Cache initialization
  Read-lock to test for nil, then write-lock with a second nil check before populating
- Cache reads
  RLock/RUnlock, allowing concurrent readers
- Cache writes / deletes
  Lock/Unlock
@neolynx neolynx requested a review from a team June 19, 2026 10:54
@neolynx neolynx added this to the 1.6.3 milestone Jun 19, 2026
@neolynx neolynx merged commit 48907fc into master Jun 19, 2026
49 checks passed
@neolynx neolynx deleted the fix/s3-race branch June 19, 2026 11:31
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.

"file already exists and is different" after un-publishing package from S3

2 participants