Avoid writing to shared memory in go-routine. #4360
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.
Signed-off-by: Michael Nelson minelson@vmware.com
Description of the change
This change is a refactor only. It updates to:
As a result, we no longer need to worry about
nil
entries in a separate slice etc.Note:
Benefits
Main benefit is that we're preferring communication via channels (and using that channel for syncing results) rather than using shared memory with an extra wait group. Not a big deal, but good to have an example to follow in other parts of the code, imo.
Possible drawbacks
Applicable issues
Additional information
I don't mind if you prefer not to change this.
Up next: I have a situation I want to investigate, where I've added the TCE repo, I can see the packages (and meta) in the cluster, but Kubeapps shows an empty catalog (both on main and in this branch). Probably something I'm doing wrong, but I'll investigate first thing tomorrow.