Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Continuous watching by reusing the resourceVersion multiple times #229

Merged
merged 2 commits into from
Nov 13, 2019

Conversation

nolar
Copy link
Contributor

@nolar nolar commented Nov 13, 2019

Optimize the K8s-watching reconnections by valid resource version

Issue: #223

Description

Currently, Kopf does 1 listing and 1 watching query per iteration: the listing is to get the latest valid resource version, from which the watching continues. The listed items are simulated to be yielded as if from a watch-stream.

When the watch-query disconnects (this happens every ~60 seconds if the timeout is not set), the whole list is re-read again. This leads to @kopf.on.resume handlers being called multiple times for no actual need.

With this PR, the watch-queries will be repeated as long as the known latest resource version value is valid (i.e. accepted by the API). Once 410 GONE error is returned, the stream will stop and escalate to the full re-listing as before.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor/improvements

Review

List of tasks the reviewer must do to review the PR

  • Tests

@nolar nolar added the bug Something isn't working label Nov 13, 2019
@nolar nolar requested a review from samurang87 as a code owner November 13, 2019 11:06
@zincr
Copy link

zincr bot commented Nov 13, 2019

🤖 zincr found 0 problems , 0 warnings

✅ Large Commits
✅ Approvals
✅ Specification
✅ Dependency Licensing

@zincr
Copy link

zincr bot commented Nov 13, 2019

🤖 zincr found 1 problem , 0 warnings

❌ Approvals
✅ Large Commits
✅ Specification
✅ Dependency Licensing

Details on how to resolve are provided below


Approvals

All proposed changes must be reviewed by project maintainers before they can be merged

Not enough people have approved this pull request - please ensure that 1 additional user, who have not contributed to this pull request approve the changes.

  • ✅ Approved by PR author @nolar
  • ❌ 1 additional approval needed
     

@nolar nolar merged commit bcf6ad7 into zalando-incubator:master Nov 13, 2019
@nolar nolar deleted the continuous-watching branch November 13, 2019 12:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants