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

Process queue items by time window #1420

Merged
merged 1 commit into from
Sep 26, 2017

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Sep 26, 2017

This allows us to avoid building and compare a new Configuration (which is expensive) with the running configuration and cases where the sync is not required.

  1. when inserting event to queue insert current timestamp with it (I will call it eventTimestamp)
  2. just before taking any item from queue store current timestamp to a variable (I will call it takeoutTimestamp)
  3. after taking item from queue complete all processing as usual. That will take some time but should leave the system synchronized at worst to the time of takeoutTimestamp
  4. after synchronization is finished pop events from the queue as long as their eventTimestamp < takeoutTimestamp. That will get rid of all the events for changes that we are sure are already part of running state.

thanks to @Gregy for the logic ^^

fixes #1386

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 26, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 26, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 43.73% when pulling 768cbb8 on aledbf:group-queue-itema into 37262bd on kubernetes:master.

@aledbf aledbf merged commit 7e6846e into kubernetes:master Sep 26, 2017
@aledbf aledbf deleted the group-queue-itema branch September 26, 2017 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nginx controller fails startup and 100% cpu usage with 100000 hosts
4 participants