diff --git a/changelog.md b/changelog.md index f1c2659862..fde7948ab8 100644 --- a/changelog.md +++ b/changelog.md @@ -10,7 +10,11 @@ and this project adheres to ### Security -Addressed all known, fixable CVEs. +- Addressed all known, fixable CVEs. + +### Fixed + +- Fixed occasional panic due to a concurrent map read/write during runtime setup. ## 0.48.0 diff --git a/pkg/runtime/depot.go b/pkg/runtime/depot.go index 97284343ec..c67b46eed4 100644 --- a/pkg/runtime/depot.go +++ b/pkg/runtime/depot.go @@ -160,6 +160,9 @@ func (d *depot) SetCacheSize(mb int) { // Artifact metadata comes from the depot's cache, and may not exist for installed artifacts that // predate the cache. func (d *depot) Exists(id strfmt.UUID) (bool, *artifactInfo) { + d.mapMutex.Lock() + defer d.mapMutex.Unlock() + if _, ok := d.artifacts[id]; ok { if artifact, exists := d.config.Cache[id]; exists { return true, artifact