Repository navigation
Watch event pipeline refactor - #746
Merged
Merged
Conversation
brandond
force-pushed
the
watch-rewrite
branch
9 times, most recently
from
August 22, 2026 02:30
9ed2fcc to
efedd0a
Compare
brandond
force-pushed
the
watch-rewrite
branch
3 times, most recently
from
September 11, 2026 06:49
3d9263c to
48ef16e
Compare
brandond
marked this pull request as ready for review
September 11, 2026 07:00
brandond
force-pushed
the
watch-rewrite
branch
3 times, most recently
from
September 11, 2026 08:36
843c5a1 to
6e04e69
Compare
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Use test dir as DB path, instead of hash to prevent writing files into working dir Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond
force-pushed
the
watch-rewrite
branch
from
September 11, 2026 09:09
6e04e69 to
fb97907
Compare
vitorsavian
approved these changes
Sep 11, 2026
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Fixes error where compact would succeed but update compact rev would time out Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Allows sending current revision along with events even when no events pass the key or revision filter. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond
force-pushed
the
watch-rewrite
branch
from
September 11, 2026 21:46
fb97907 to
b5ac893
Compare
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Avoid allocating the response until we know its actually going to be sent. Since most eventless sends end up getting surpressed by to the notification interval, this reduces the number of WatchResponse allocations by several orders of magnitude. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond
force-pushed
the
watch-rewrite
branch
from
September 11, 2026 22:07
b5ac893 to
b243d15
Compare
manuelbuil
approved these changes
Sep 14, 2026
manuelbuil
left a comment
There was a problem hiding this comment.
Looks very good Brad. It addresses all the points in the issue and the logging looks good for debugging revisions,etc. My only concern is that, If I understand correctly, messages will now stay a bit longer inside Kine before being filtered out. I was wondering if that means any relevant extra CPU/Memory requirement. I guess not
Member
Author
|
@manuelbuil they make it through an additional channel before being filtered out now yes, but since all receivers get the same event list there's no additional memory utilization. Just a bit more work for the final goroutine that is now seeing more than it used to. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Major refactor of the watch event pipeline, along the lines of the plain laid out in:
Todo:
The watch server should drop GRPC clients that fall behind on receiving messages. Etcd uses a WatchResponse message queue for this, and drops clients if the queue reaches a maximum size, or if the send fails.Leaving this unhandled for now, as it is not something we have done in the past, nor has it caused any problems.
In addition to actually guaranteeing that watchers are synced before sending progress notifications (instead of simply checking that the poll loop has sent events for a revision into the channel), this also does away with the 100 millisecond delay that was artificially added to progress notification responses. This plus the 1 second poll interval was a cause of significant slowness (0.1 to 1.1 seconds * number of namespaced resource types present in the cluster) when the apiserver requested progress notifications to ensure that all resources are deleted from a namespace. (ref k3s-io/k3s#14399)