Skip to content

fix: add mutex to LocalRepositoryCache to prevent concurrent map panic#6109

Open
AruneshDwivedi wants to merge 2 commits into
nektos:masterfrom
AruneshDwivedi:fix/local-repository-cache-race
Open

fix: add mutex to LocalRepositoryCache to prevent concurrent map panic#6109
AruneshDwivedi wants to merge 2 commits into
nektos:masterfrom
AruneshDwivedi:fix/local-repository-cache-race

Conversation

@AruneshDwivedi

@AruneshDwivedi AruneshDwivedi commented Jun 5, 2026

Copy link
Copy Markdown

CacheDirCache in LocalRepositoryCache was a plain map accessed concurrently by Fetch (write) and GetTarArchive (read) during parallel matrix jobs. This caused occasional panics with "concurrent map read and map write".

Added sync.RWMutex to protect all map accesses.

Fixes #6109

…l/bin

The install script was defaulting to ./bin (relative to current
working directory) instead of a proper user bin directory. This
caused act to be installed in whatever directory the user happened
to be in when running the install script, making it unfindable.

Fixes nektos#2519
LocalRepositoryCache.CacheDirCache is a plain map accessed concurrently
by Fetch (write) and GetTarArchive (read) when multiple matrix jobs
resolve --local-repository actions in parallel. This causes intermittent
'concurrent map read and map write' panics.

Add a sync.RWMutex to protect CacheDirCache access:
- Write lock in Fetch when storing to CacheDirCache
- Read lock in GetTarArchive when reading from CacheDirCache

This is the same class of bug as nektos#6028 (fixed in nektos#6029 for GoGitActionCache).

Fixes nektos#6057
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant