Commit Graph

303 Commits

Author SHA1 Message Date
Jordan Liggitt
0693903770 Fix or remove tests that don't work in race mode
Kubernetes-commit: 68bb8b827b3827cbee61d3fcc560738beba3e110
2021-03-04 09:51:52 -05:00
Nikhita Raghunath
1d0cb03f5a *: remove nikhiljindal from OWNERS
Kubernetes-commit: 6cef3a4e33c10c27bb301a1070ea3ff4cdad0c39
2021-02-16 10:50:50 +05:30
Nikhita Raghunath
e8ab2528ca *: remove madhusudancs from reviewers
Kubernetes-commit: 6b12c96a9b7fe4d7c03d0dfed447edd6b1055067
2021-02-16 10:40:42 +05:30
Victor Timofei
53a09c71a4 Update the wording of the DeltaFIFO
Kubernetes-commit: 3a107951f0bf16a022b70a667c98833e4ac1d540
2020-12-24 16:33:04 +02:00
Victor Timofei
710a222444 Move Delta definitions to the top
Kubernetes-commit: bcc1c9a387c898478ed47c629864418be89bf518
2020-12-15 22:07:33 +02:00
Victor Timofei
09cf7147ab Update DeltaFIFO Documentation
Kubernetes-commit: 1a4ed5ea57ac4d562311d2b2852dcc59b78725da
2020-12-15 21:31:30 +02:00
pacoxu
8031d76bd6 fix index test: multi index check for empty list
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: ae6360f6c732d554c332a0bc1b99808149d8376e
2020-11-26 18:23:57 +08:00
Qing Ju
1d175299a2 Fixed a harmless bug where initialPopulationCount should be based on the key length not list size in DeltaFIFO#Replace()
Kubernetes-commit: bc39672c0638426979feef95baeff39d170161eb
2020-11-22 16:35:19 -08:00
wojtekt
866e6a7e3c Allow tracking resource version for reflector store
Kubernetes-commit: 4af1328bb8a3b3eb2289bbbe624480548dd39cdc
2020-08-31 15:58:16 +02:00
Maciej Borsz
a52faa7892 Add WatchListPageSize to cache.Config
Currently there is no way to specify WatchListPageSize used by Controller. This PR adds a field that can be used to specify this.

Change-Id: I241454a45dd94d3ea65a91b297f530e217f843aa

Kubernetes-commit: 43f5afe1a1dd058a2564cd3b2f330fc2a401f607
2020-08-31 12:52:45 +02:00
azush26
5f6a1b08cd modify the warning log format from %d to %v
Kubernetes-commit: ac1168e0e922ccd32b0fcc3d3aecac8920cedbda
2020-08-12 16:05:59 +09:00
Kevin Delgado
4d01b584c3 Add exp backoff for connection refused errors
Currently when ListAndWatch() receives a connection refused error, it is
assumed to be due to the apiserver being transiently unresponsive. In
situations where a controller is running outside the k8s cluster it's
controlling, it is more common for the controller to lose connection
permanently to the apiserver and needs to exponentially backoff its
retry rather than continously spamming logs with Watch attempts that
will never succeed.

Kubernetes-commit: 1ff789f2bb9bf7fbb3df35977bc249c0dd019d31
2020-08-25 19:15:21 +00:00
janeczku
47f16e33aa Fixed reflector not recovering from "Too large resource version" errors with API servers 1.17.0-1.18.5
Kubernetes-commit: e1f4bfe1db8d3975bf626c2c8536dd8076aeb7d4
2020-08-28 21:17:27 +02:00
gobomb
330cb14339 let panics propagate up when processLoop panic
Kubernetes-commit: 19a3ca2c289b6f3dc8cd495e3db0d347b5a3b774
2020-08-03 09:30:39 +00:00
Nikhita Raghunath
480d796592 apimachinery: remove inactive members from OWNERS
Kubernetes-commit: db495ea9837cf840639a4e02085253fb341e12b5
2020-07-11 19:28:24 +05:30
Mike Spreitzer
53f29dc721 Replaced repair with returning error, in delta_fifo.go
When dedupDeltas does the impossible and the key is already queued,
return an error rather than maintain the data structure invariants.

Kubernetes-commit: a39481a4f6cf33f9bf4555adcffa28077863e7a9
2020-07-08 01:15:51 -04:00
Mike Spreitzer
a166e2578b Repair instead of panic when data corruption detected in DeltaFIFO
Kubernetes-commit: abcd0f82c5634c7a23b9390172b7c6ae907d84f7
2020-07-02 23:23:59 -04:00
Mike Spreitzer
826338c319 Remove contemplation of invariant violations from delta_fifo.go
Some comments and code incorrectly contemplated violating the
invariant that a keys is in `f.items` if and only if it is in
`f.queue`.

Also fixed up some comment wording.

Kubernetes-commit: 5efd727d112206ef9a8ede93c5878b0d40707ae9
2020-06-09 18:57:28 -04:00
Benjamin Elder
d68fd20f32 remove david-mcmahon from reviewers
Kubernetes-commit: d8f2b131b52b5f296818da50e66bba51a1e05c01
2020-06-30 14:06:58 -07:00
Benjamin Elder
1a4844dbb1 eparis to emeritus
Kubernetes-commit: 2abc8afececeadad26c6bb90d3b096f2b8008131
2020-06-30 09:50:44 -07:00
wojtekt
ec46b97af4 Fix bug in reflector not recovering from "Too large resource version" errors
Kubernetes-commit: 3704174f95c7311e025284ef30bb56945fa6e7cc
2020-06-26 09:45:29 +02:00
Qing Ju
89cf2be62c Added clarification to delta FIFO doc
Kubernetes-commit: c71272b0c7ac09991ba215e7bc5a8af8334c4b17
2020-05-25 19:48:10 -07:00
dopelsunce
73aa499de0 Fix race condition between Pop and Close FIFO queue
Fixes: kubernetes#90581 (the first part)

When `Close()` is invoked on an empty queue, the control loop inside `Pop()` has a small chance of missing the signal and blocks indefinitely due to a race condition. This PR eliminates the race and allows the control loop inside any blocking `Pop()` to successfully exit after Close() is called.

Kubernetes-commit: d8b90955519d10b99415515f8314dd6d35caae8d
2020-05-06 19:01:13 -05:00
Qing Ju
aea2fc6906 Polished up HasSync comment
Kubernetes-commit: 168d0848299a625b9d4d2b85923efc60ed7de734
2020-05-16 20:41:07 -07:00
Davanum Srinivas
75fea27a27 switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
Jordan Liggitt
33c1f9f2a4 Fix client watch reestablishment handling of client-side timeouts
Kubernetes-commit: 343c1e7636fe5c75cdd378c0b170b26935806de5
2020-03-30 10:36:01 -04:00
Nick Santos
ccd5becdff cache: add error handling to informers
When creating an informer, this adds a way to add custom error handling, so that
Kubernetes tooling can properly surface the errors to the end user.

Fixes https://github.com/kubernetes/client-go/issues/155

Kubernetes-commit: 435b40aa1e5c0ae44e0aeb9aa6dbde79838b3390
2020-01-17 12:46:08 -05:00
Mike Spreitzer
d7a772a8de Documented mutation restriction for informer clients
Also brushed up some other informer comments for readability and
nitpicking accuracy.

Kubernetes-commit: c4774de94a80bb7d0f54a8a728ad3e97ad1a07b9
2020-03-16 17:38:14 -04:00
Mike Spreitzer
49f8c8f17a More refinement of comments and parameter names for informers
Removed the incorrect promise of coherency in the answer to a query to
an informer's local cache.  Removed the definition of "collection
state", because it was only used in the now-removed promise.  Added a
remark about ordering of states that appear in an informer's local
cache.

Brushed up the commentary on resync period.  Changed the relevant
parameter of NewSharedInformer to have the same name as the
corresponding parameter to NewSharedIndexInformer.

Kubernetes-commit: b8e2ad5926c3a6872422ad25cf9867e10e052a7d
2020-01-26 02:43:33 -05:00
Jordan Liggitt
b0779d525a Shrink mutation detection critical section
Kubernetes-commit: 12abf03f6b4a60fa61773acd21dfb440ff10f699
2020-02-13 22:22:14 -05:00
Harry Zhang
1df276a7c6 add exponential backoff with reset to reflector
Kubernetes-commit: f1248163ff4dc3cf164284bf255c10b6b538aa66
2020-02-03 15:32:51 -08:00
Jordan Liggitt
08cc53159f Treat replaced events that didn't change resourceVersion as resync events
Kubernetes-commit: a6caa0a4726ba97737056175494516367cf98cae
2020-02-08 16:30:01 -05:00
wojtekt
0e2dbbf70a Switch pager to return whether the result was paginated
Kubernetes-commit: 5dcf08c1993718e94cf6537af50e0a411dd2878c
2020-01-28 09:39:27 +01:00
wojtekt
5534e24283 Avoid thundering herd on etcd on masters upgrade
Kubernetes-commit: 773d3583bcb7a2ac39c772a9861978d81db0df2f
2019-12-30 13:53:28 +01:00
Mike Danese
b136e9eb2b refactor
Kubernetes-commit: d55d6175f8e2cfdab0b79aac72046a652c2eb515
2020-01-27 18:19:44 -08:00
Mike Spreitzer
cc22aafc1f remove unused layer of loop structure in processorListener::run
Also updated the comment inside processorListener::run, to restore
accuracy about how long the delay is.

Kubernetes-commit: d2ad469abbb1122cbbd772e15767817cd771f9f6
2020-01-20 11:52:44 -05:00
Casey Callendrello
b775e00fe5 informers: don't treat relist same as sync
Background:

Before this change, DeltaFIFO emits the Sync DeltaType on Resync() and
Replace(). Seperately, the SharedInformer will only pass that event
on to handlers that have a ResyncInterval and are due for Resync. This
can cause updates to be lost if an object changes as part of the Replace(),
as it may be incorrectly discarded if the handler does not want a Resync.

What this change does:

Creates a new DeltaType, Replaced, which is emitted by DeltaFIFO on
Replace(). For backwards compatability concerns, the old behavior of
always emitting Sync is preserved unless explicity overridden.

As a result, if an object changes (or is added) on Replace(), now all
SharedInformer handlers will get a correct Add() or Update()
notification.

One additional side-effect is that handlers which do not ever want
Resyncs will now see them for all objects that have not changed during
the Replace.

Kubernetes-commit: ca1eeb99b530a6d76b464dad545abc18d4508c49
2019-12-16 18:34:30 +01:00
Casey Callendrello
802190f49e client-go/cache/testing: add ability to simulate watch disruption
This adds ResetWatch() to the FakeControllerSource, which lets the
controller simulate a re-list-and-watch.

Kubernetes-commit: 5aacacbdf000cee2d0ec548ee4afe564f35c60bf
2019-12-06 22:19:42 +01:00
Mike Spreitzer
d01661091c Further tweaking up the wording
Hopfully improving, based on wojtek's review.

Kubernetes-commit: 59807be5abe6a96aad715823b7bab9fbd5d837bd
2020-01-10 16:05:41 -05:00
Mike Spreitzer
4aedce0891 gofmt reflector.go
Kubernetes-commit: 729337ec7e4251708b75f45ad40b7fa55ad14dd5
2020-01-07 08:56:31 -05:00
Mike Spreitzer
a1b3b98c4b Clarified comment on DeltaFIFO::Replace
Kubernetes-commit: ae53a008cb372f7301e302ee982269630e964b12
2020-01-07 02:40:01 -05:00
Mike Spreitzer
c68732b808 finished pass over comments on Controller, and commented sharedIndexInformer
Kubernetes-commit: f2a8e2d9c9cadc8a969efa1d4edef833ff701e2f
2020-01-07 02:23:29 -05:00
Mike Spreitzer
edca648925 A little more comment tweaking for cache.Controller
Kubernetes-commit: 7d82e23e6cd61af212e73f6fb77c2f74c1628a84
2020-01-06 16:11:26 -05:00
Mike Spreitzer
db5618cb1f began turning attention to cache.Controller
Kubernetes-commit: 72fa714d636dc2f614b251c78cd8297f7754b333
2020-01-06 15:59:11 -05:00
Mike Spreitzer
261b8a00e4 Reworded comment on requestedResyncPeriod
Tried to make it clearer.

Kubernetes-commit: 2ea338b63f2191d859ac68fbba74c93c1d7bc998
2020-01-06 13:10:39 -05:00
Mike Spreitzer
8454aaf1be Noted divergence between requestedResyncPeriod and resyncPeriod
Kubernetes-commit: eef49c965f471d575aef8de5f071ffc6fd31c44d
2020-01-06 01:56:52 -05:00
Mike Spreitzer
1f6e3b32af Started commenting processors
Kubernetes-commit: 5546d9f12f266a082805ad3a2293fe04e0029c78
2020-01-06 01:49:29 -05:00
Mike Spreitzer
2f9f325a3b Fix tests and improve comment on NewDeltaFIFO
Kubernetes-commit: 0eca8ae9cdbbbe0e5bf56f9931acdaa97cea91af
2020-01-03 01:01:05 -08:00
Mike Spreitzer
bad9a45b33 Fixed assignment statements
Kubernetes-commit: 1d65f1b5c3977362fb5a32b9cfe5b9930fabf16a
2020-01-03 00:47:19 -08:00
Mike Spreitzer
0421cde51b Revised comments about f.knownObjects and added tests for Replace
Kubernetes-commit: 89c615f9c448503b674a0d61bfa8e413cefa4104
2020-01-03 00:44:02 -08:00