Copy the labels map before editing #4021
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3958
The logs showed a crash during rendering the metadata.Labels field. This was a crash that was completely outside the path of any of our code - meaning that extra locking won't help, because we can't change the API server code to grab a lock. The code was serving something up from a cache, so we must have been modifying the data in that cache at the same time.
I found a couple places that we tweak the Labels field, and these are areas of the code that were active in other runnable goroutines, so I am pretty sure they are the culprit. I have been running the new build for a few hours now, and no crashes. The released version was crashing ~1 per hour. Let's let it steep over the weekend.
/hold