This repository was archived by the owner on Apr 29, 2020. It is now read-only.
changed buffered channel#1034
Open
yzaccc wants to merge 1 commit intosquare:masterfrom
yzaccc:yangzongkun/p2-prepare-add-buffer-to-podChanMap-channel
Open
changed buffered channel#1034yzaccc wants to merge 1 commit intosquare:masterfrom yzaccc:yangzongkun/p2-prepare-add-buffer-to-podChanMap-channel
yzaccc wants to merge 1 commit intosquare:masterfrom
yzaccc:yangzongkun/p2-prepare-add-buffer-to-podChanMap-channel
Conversation
mpuncel
reviewed
Mar 27, 2018
pkg/preparer/orchestrate.go
Outdated
| go p.store.WatchPods(consul.INTENT_TREE, p.node, quitChan, errChan, podChan) | ||
|
|
||
| podChanMap := make(map[podWorkerID]chan ManifestPair) | ||
| podChanMap := make(map[podWorkerID]chan ManifestPair, 1) |
Collaborator
There was a problem hiding this comment.
i think you actually want to buffer the chan ManifestPair on line 123
mpuncel
reviewed
Mar 27, 2018
pkg/preparer/orchestrate.go
Outdated
| @@ -89,11 +89,11 @@ func (p *Preparer) WatchForPodManifestsForNode(quitAndAck chan struct{}) { | |||
| // buffer this with 1 manifest so that we can make sure that the | |||
| // consumer is always reading the latest manifest. Before writing to | |||
| // this channel, we will attempt to drain it first | |||
Collaborator
There was a problem hiding this comment.
you should move this comment to the place the actual buffering is
Author
|
Disabled race testing for orchestrate test. |
mpuncel
reviewed
Mar 28, 2018
| @@ -1,3 +1,5 @@ | |||
| // +build !race | |||
Collaborator
There was a problem hiding this comment.
what race did you hit? looks like this file doesn't depend on consulutil which has known races, so if the race detector showed a problem it's probably a real problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This commit is a complementary for this commit
Ensuring that the preparer is always using the latest pod manifest