Skip to content

Commit 1520947

Browse files
Merge pull request #609 from xueqzhan/revert-607-revert-601-lockCreateSamples
OCPBUGS-52848: Unrevert the revert "OCPBUGS-45049: Adding mutex to func createSamples on handler.go"
2 parents 33b3a8e + 5fbe29c commit 1520947

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/stub/handler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,8 @@ func (h *Handler) abortForDelete(cfg *v1.Config) bool {
11511151
func (h *Handler) createSamples(cfg *v1.Config, updateIfPresent, registryChanged bool, unskippedStreams, unskippedTemplates map[string]bool) (bool, error) {
11521152
// first, got through the list and prime our upsert cache
11531153
// prior to any actual upserts
1154+
h.mapsMutex.Lock()
1155+
defer h.mapsMutex.Unlock()
11541156
imagestreams := []*imagev1.ImageStream{}
11551157
for _, fileName := range h.imagestreamFile {
11561158
if h.abortForDelete(cfg) {

0 commit comments

Comments
 (0)