-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor syncNetworkEndpoints #1931
Conversation
Hi @sawsa307. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @swetharepakula |
/ok-to-test |
673626e
to
55d8a4f
Compare
pkg/neg/syncers/transaction.go
Outdated
for zone, batches := range attachBatchMap { | ||
for _, batch := range batches { | ||
s.logger.V(3).Info("wg increse by one") | ||
s.wg.Add(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can greatly simplify this refactor by adding to the wait groups into attachNetworkEndpoints and detachNetworkEndpoints instead which will be marked as done in operationInternal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! As discussed offline, now collectSyncResult will only wait for all goroutine to finish and emit metrics.
55d8a4f
to
7bd534d
Compare
7bd534d
to
84b7ce6
Compare
pkg/neg/syncers/transaction.go
Outdated
// collectSyncResult collects the result of the sync and emits the metrics for sync result | ||
func (s *transactionSyncer) collectSyncResult() { | ||
s.wg.Wait() | ||
s.logger.V(3).Info("Done collecting result.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this publish something about the result or metric?
84b7ce6
to
a4a7cc5
Compare
func (s *transactionSyncer) collectSyncResult() { | ||
s.wg.Wait() | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this function, what is the proposed way to collect the results? How will you get the aggregate result of all the goroutines?
a4a7cc5
to
a288318
Compare
Add a waitgroup that waits for the completeness of all NEG oeprations.
a288318
to
26a19fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sawsa307, swetharepakula The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add a waitgroup that waits for the completeness of all NEG operations.