You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-api-machinery/3157-watch-list/README.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -372,7 +372,7 @@ Step 2: Right after receiving a request from the reflector, the cacher gets the
372
372
It is used to make sure the cacher is up to date (has seen data stored in etcd) and to let the reflector know it has seen all initial data.
373
373
There are ways to do that cheaply, e.g. we could issue a count request against the datastore.
374
374
Next, the cacher creates a new cacheWatcher (implements watch.Interface) passing the given bookmarkAfterResourceVersion, and gets initial data from the watchCache.
375
-
After sending initial data the cacheWatcher starts listening on an incoming channel for new events, including a bookmark event.
375
+
After sending initial data the cacheWatcher starts listening on an input channel for new events, including a bookmark event.
376
376
At some point, the cacher will receive an event with the resourceVersion equal or greater to the bookmarkAfterResourceVersion.
377
377
It will be propagated to the cacheWatcher and then back to the reflector as a BOOKMARK event.
378
378
@@ -386,9 +386,9 @@ Since the watchCache implements the Store interface it is used by the reflector
386
386
Step 2b: What happens when new events are received while the cacheWatcher is sending initial data?
387
387
388
388
The cacher maintains a list of all current watchers (cacheWatcher) and a separate goroutine (dispatchEvents) for delivering new events to the watchers.
389
-
New events are added via the cacheWatcher.nonblockingAdd method that adds an event to the cacheWatcher.incoming channel.
390
-
The cacheWatcher.incoming is a buffered channel and has a different size for different Resources (10 or 1000).
391
-
Since the cacheWatcher starts processing the cacheWatcher.incoming channel only after sending all initial events it might block once its buffered channel tips over.
389
+
New events are added via the cacheWatcher.nonblockingAdd method that adds an event to the cacheWatcher.input channel.
390
+
The cacheWatcher.input is a buffered channel and has a different size for different Resources (10 or 1000).
391
+
Since the cacheWatcher starts processing the cacheWatcher.input channel only after sending all initial events it might block once its buffered channel tips over.
392
392
In that case, it will be added to the list of blockedWatchers and will be given another chance to deliver an event after all nonblocking watchers have sent the event.
393
393
All watchers that have failed to deliver the event will be closed.
0 commit comments