Skip to content

Commit 6ef187f

Browse files
authored
Merge pull request #4361 from likakuli/kep-3157
KEP-3157: correct description of cachewatcher channel
2 parents 51460ee + 20459af commit 6ef187f

File tree

1 file changed

+4
-4
lines changed
  • keps/sig-api-machinery/3157-watch-list

1 file changed

+4
-4
lines changed

keps/sig-api-machinery/3157-watch-list/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ Step 2: Right after receiving a request from the reflector, the cacher gets the
372372
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.
373373
There are ways to do that cheaply, e.g. we could issue a count request against the datastore.
374374
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.
376376
At some point, the cacher will receive an event with the resourceVersion equal or greater to the bookmarkAfterResourceVersion.
377377
It will be propagated to the cacheWatcher and then back to the reflector as a BOOKMARK event.
378378

@@ -386,9 +386,9 @@ Since the watchCache implements the Store interface it is used by the reflector
386386
Step 2b: What happens when new events are received while the cacheWatcher is sending initial data?
387387

388388
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.
392392
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.
393393
All watchers that have failed to deliver the event will be closed.
394394

0 commit comments

Comments
 (0)