Skip to content

Commit 4999497

Browse files
committed
Fix panic on simultaneous map write
1 parent e69e7b9 commit 4999497

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/runtime/depot.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ func (d *depot) Path(id strfmt.UUID) string {
137137
// necessary information. Writing externally is preferred because otherwise the depot would need a lot of specialized
138138
// logic that ultimately don't really need to be a concern of the depot.
139139
func (d *depot) Put(id strfmt.UUID) error {
140+
d.fsMutex.Lock()
141+
defer d.fsMutex.Unlock()
142+
140143
if !fileutils.TargetExists(d.Path(id)) {
141144
return errs.New("could not put %s, as dir does not exist: %s", id, d.Path(id))
142145
}

0 commit comments

Comments
 (0)