Skip to content
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

[WIP] Skip processing ADD events of init Pods and Namespaces #636

Closed
wants to merge 1 commit into from

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Apr 20, 2020

No description provided.

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-all: to trigger all tests.
  • /skip-all: to skip all tests.

These commands can only be run by members of the vmware-tanzu organization.

@tnqn
Copy link
Member Author

tnqn commented Apr 20, 2020

/test-all

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Changes look good to me. Do you think you could add some of the tests we talked about a while back by email?

@@ -1208,11 +1238,11 @@ func (n *NetworkPolicyController) syncInternalNetworkPolicy(key string) error {
// Lock the internal NetworkPolicy store as we may have a case where in the
// same internal NetworkPolicy is being updated in the NetworkPolicy UPDATE
// handler.
n.internalNetworkPolicyMutex.Lock()
n.internalNetworkPolicyMutex.RLock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be an orthogonal change, do you think you can put it in a separate PR that we can merge right away?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually we do update the store at L1271.. should this be R?


// initPodSet caches UIDs of the Pods that exist before starting computation.
// We don't need to handle their ADD events as all AddressGroups and AppliedToGroups
// will be computed once at the beginning and they have counted these Pods in.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of "all AddressGroups and AppliedToGroups will be computed once at the beginning and they have counted these Pods in.", do you think it would be more accurate to say "all AddressGroups and AppliedToGroups will be computed when the ADD events for NetworkPolicies are processed and they will account for these Pods"?

npController.podListerSynced = alwaysReady
npController.namespaceListerSynced = alwaysReady
npController.networkPolicyListerSynced = alwaysReady
//npController.podListerSynced = alwaysReady
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just checking: do we need to remove this because otherwise the List operations may not return the entire set of Pods / Namespaces?

do you know why we used alwaysReady in the first place, I can't remember?

@antrea-bot
Copy link
Collaborator

Can one of the admins verify this patch?

Base automatically changed from master to main January 26, 2021 00:00
@tnqn
Copy link
Member Author

tnqn commented Mar 19, 2021

#1937 took care of this via pkg/controller/grouping.Interface.HasSynced

@tnqn tnqn closed this Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants