Commit Graph

2517 Commits

Author SHA1 Message Date
Kubernetes Publisher 6b396918ed Merge pull request #75853 from roycaihw/fix/use-standard-stacktrace
apimachinery & apiserver: use stacktrace in the stdlib

Kubernetes-commit: f8d0b21b980f33e218b7e1f01a13bf3bd90713f9
2019-04-06 05:28:22 +00:00
Kubernetes Publisher 4a7b414073 Merge pull request #76196 from kubernetes/revert-75547-improve_the_efficiency_of_delivery_watch_events
Revert "delivery event non blocking firstly"

Kubernetes-commit: f1693efe3713f065d33a5f0d31df0bec0a966bc0
2019-04-05 17:31:42 +00:00
Kubernetes Publisher 7a95a9d2b2 Merge pull request #76162 from nikhita/bump-gengo
Bump gengo to avoid large errors in verify logs

Kubernetes-commit: 223f355ba47e20affd41d035c7fc1e471f5a2acf
2019-04-05 17:31:41 +00:00
Wojciech Tyczynski 670ff8c10b Revert "delivery event non blocking firstly"
Kubernetes-commit: cea9d65a2c9add769b4f5c0473a1ba3ae6ce0d8b
2019-04-05 15:36:08 +02:00
Kubernetes Publisher 5a10509a60 Merge pull request #76175 from stealthybox/refactor-mediatype-loops
Refactor loops over `SupportedMediaTypes()` where mediaType is used to match a single SerializerInfo{}

Kubernetes-commit: 84b561033eea9a4dac5b04df4f387efa7a7e9940
2019-04-05 09:31:34 +00:00
Kubernetes Publisher 8156e5027a Merge pull request #76153 from liggitt/update-vendor-cleanup
Update vendor cleanup

Kubernetes-commit: 470bda42c382ff0c02ac9fd5cbfcd4ee5e081cb1
2019-04-05 09:31:33 +00:00
Kubernetes Publisher 97631abc38 Merge pull request #76098 from smarterclayton/move_direct_encoder
Move DirectEncoder to runtime, rename, add .WithoutConversion() on CodecFactory

Kubernetes-commit: 28295b0e784ab1f9f1a1aada5955bbf224cf59cc
2019-04-05 05:31:33 +00:00
Kubernetes Publisher e76d8352b8 Merge pull request #76065 from hormes/add_timeout_support_for_watch
add timeout support for watch

Kubernetes-commit: 72ed03fed48fbac93c7cd4acd0adc70e4a6b8482
2019-04-05 05:31:31 +00:00
leigh capili 7762f62741 Refactor loops over SupportedMediaTypes() where mediaType is used to match a single SerializerInfo{}
We have an existing helper function for this:  runtime.SerializerInfoForMediaType()

This is common prep-work for encoding runtime.Objects into JSON/YAML for transmission over the wire or writing to ComponentConfigs.

Kubernetes-commit: 47e52d2981dc2a5c5950042f50688cf24dd92eda
2019-04-04 19:01:01 -06:00
Nikhita Raghunath 9f3c8a2eed bump(k8s.io/gengo): f8a0810f38afb8478882b3835a615aebfda39afa
Kubernetes-commit: 2095ac9b069ef9fec8e7c0dd4836357b0914124c
2019-04-04 23:50:06 +05:30
Jordan Liggitt 362ad0a8f7 generated
Kubernetes-commit: f5ea2344ae69015f6970dd045ea6087e9cbe7121
2019-04-04 11:51:03 -04:00
Kubernetes Publisher bf0cd89bc4 Merge pull request #76087 from sttts/sttts-fail-feature-gate-errors
Handle feature gate errors

Kubernetes-commit: 4e728efbd6d3e389cf97463f064613d1b4d6d419
2019-04-04 07:07:29 +00:00
Kubernetes Publisher fb0d7b20d1 Merge pull request #75389 from jpbetz/pagination-v1
Paginate watch cache->etcd List calls & reflector init/resync List calls not served by watch cache

Kubernetes-commit: c79fbabf234bea36f7b870da8e763c542c804be0
2019-04-04 07:07:28 +00:00
Kubernetes Publisher 04665e6b9c Merge pull request #74877 from liggitt/go-mod-cleanup
add go module support, manage vendor directory using go modules

Kubernetes-commit: d920430ce4a9140102d06664c6aa1cd6792cab05
2019-04-04 07:07:26 +00:00
Clayton Coleman e4e8608ba0 Use CodecFactory.WithoutConversion() everywhere
Clarifies that requesting no conversion is part of the codec factory, and
future refactors will make the codec factory less opionated about conversion.

Kubernetes-commit: 7f9dfe58f4cbe1e1b9e80f52addff70bac87bed4
2019-04-03 13:24:37 -04:00
Dr. Stefan Schimanski 541d02b251 Handle feature gate errors
Kubernetes-commit: 37046e30282ad1ea29f7b2998a6b1b56e864f5be
2019-04-03 16:49:49 +02:00
fansong.cfs 73057f16b6 add timeout suuport for watch
Kubernetes-commit: b304a1f96d85cd351a0e22a091e17064d5edb35e
2019-04-03 09:37:48 +08:00
Haowei Cai 4ff581692b remove TrimSuffix and document buffer size
Kubernetes-commit: 0e61b77826f23cbf835002a9eef5722bb1cfdf53
2019-04-01 11:02:39 -07:00
Jordan Liggitt 16ff6b1e59 generated: hack/update-vendor.sh
Kubernetes-commit: d0261b10770210f83edbcfe379db24e1b82a9e86
2019-04-01 11:07:04 -04:00
Kubernetes Publisher cbb436552f Merge pull request #75547 from hormes/improve_the_efficiency_of_delivery_watch_events
delivery event non blocking firstly

Kubernetes-commit: c19dc742c4e05fb7c53e54e527f43eccd174ecc1
2019-04-04 07:06:54 +00:00
Kubernetes Publisher 9b20910895 Merge pull request #76002 from BenTheElder/revert-75835
Revert "add timeout suuport for watch"

Kubernetes-commit: e6844c21a46a2b5c7b802fe477f7a3a3c0fab087
2019-04-02 10:51:05 +00:00
Kubernetes Publisher 8b6e55f1c0 Merge pull request #75953 from wojtek-t/add_etcd_metrics
Expose etcd client latency metrics

Kubernetes-commit: fd23c84022afc68b6defc68fc31c804f7b96e426
2019-04-02 10:50:18 +00:00
Kubernetes Publisher d1e178ce07 Merge pull request #75971 from smarterclayton/fix_partialobjectmeta_list
Correctly send list metadata with v1beta1 PartialObjectMetadataList

Kubernetes-commit: a3ae6c43c266ebfb7496430f2938993c6de81440
2019-04-02 06:50:48 +00:00
Benjamin Elder 8ad12b3912 Revert "add timeout suuport for watch"
This reverts commit c676e234cc1036a2a1147f2eeef9c89468671330.

Kubernetes-commit: 30a56bab42ab14a3a2ee21f5581b02525d4fd110
2019-04-01 18:39:17 -07:00
wojtekt 1fd6bb259f Expose etcd client latency metrics
Kubernetes-commit: d5c9ad80499a9148a40b8a6c33c165cf12578649
2019-04-01 12:46:06 +02:00
Haowei Cai 278cabecf3 document the usage of errCh
Kubernetes-commit: 5809b6a4282f7ce58e0d815d9326289a8ee7ddb6
2019-03-28 16:55:03 -07:00
Clayton Coleman f2b20f65e2 Set list meta on PartialObjectMetadataList during transform
Kubernetes-commit: 6801ce990a48196d871f6b46e1a08938025ce7c5
2019-03-24 21:29:20 -04:00
Kubernetes Publisher d20c276e09 Merge pull request #75835 from hormes/add_timeout_to_watch
add timeout support  for Watch()

Kubernetes-commit: 782ed5ce13ca43842b803f27e96201d233533768
2019-04-01 14:53:08 +00:00
fansong.cfs 4d2b8eee69 add timeout suuport for watch
Kubernetes-commit: c676e234cc1036a2a1147f2eeef9c89468671330
2019-03-30 20:07:41 +08:00
Kubernetes Publisher 4239377881 Merge pull request #75879 from hormes/watchcache_refactor
Refactor watchcache to pass function to create objects instead of the empty object  itself

Kubernetes-commit: 2f62e8ff57de313e02e1565bd4762f822a442132
2019-03-29 18:52:04 +00:00
fansong.cfs 9130ee52b5 Refactor watchcache to support bookmark
Kubernetes-commit: b29e69c1562f66cf339ae7cd58979528791f035f
2019-03-29 17:49:15 +08:00
Kubernetes Publisher 34f0f00795 Merge pull request #75760 from wojtek-t/follow_comment_from_critical_sections
Add explanation about forgetFunc in cacher

Kubernetes-commit: 312eb890e6cf81fab43d88ae569802689a683065
2019-03-28 02:53:12 +00:00
Kubernetes Publisher dc9fd9c468 Merge pull request #75748 from smarterclayton/request_scope_as_pointer
Make RequestScope be a pointer consistently for better memory use

Kubernetes-commit: a519e91256d54e51dc1693d17e7eb353e5870f36
2019-03-28 02:52:26 +00:00
Kubernetes Publisher 638fa8f764 Merge pull request #75755 from smarterclayton/save_one_allocate
Avoid allocating the watch shim object more than once

Kubernetes-commit: 6c22cff31747c17a46183171a2834feb1d67002e
2019-03-27 02:14:48 -07:00
wojtekt 6c2f66a5b5 Add explanation about forgetFunc in cacher
Kubernetes-commit: 605522b0c714c173d0a1ec8d00e46c3629107267
2019-03-27 08:24:45 +01:00
Clayton Coleman 8e43494f09 Avoid allocating the watch shim object more than once
We can reset and reuse this object repeatedly without triggering an
allocation.

Kubernetes-commit: 316a87ce7dff525555483eaac962899fd365177d
2019-03-26 23:34:25 -04:00
Kubernetes Publisher 90d1c0aa0a Merge pull request #75743 from logicalhan/preshutdownerror
log preshutdowndown registration error if we encounter one

Kubernetes-commit: 42770799d31febf47fadd376748c7c9efc51ea55
2019-03-27 02:53:47 +00:00
Kubernetes Publisher 53a7466644 Merge pull request #75717 from wojtek-t/reduce_critical_sections
Reduce critical sections in cacher::Watch function

Kubernetes-commit: df9e66628ce43f5fbc806bb16554bff8276fbcf1
2019-03-27 02:52:59 +00:00
Kubernetes Publisher b37a96d129 Merge pull request #75699 from smarterclayton/fast_encode
Avoid allocations when building SelfLinks and fast path escape

Kubernetes-commit: 1514bb2141d3c82830f64aa0e1f8c3650116b803
2019-03-26 22:54:34 +00:00
Han Kang 18a2d0a0ba log preshutdowndown registration error if we encounter one
Kubernetes-commit: 021f6082944496765383c7572157e9be86ed4177
2019-03-26 13:04:10 -07:00
Clayton Coleman c8f7d5017d Make RequestScope be a pointer consistently for better memory use
RequestScope is a large struct and causes stack growth when we pass
it by value into multiple stack levels. Avoid the allocations for
this read only struct by passing a pointer.

Kubernetes-commit: 8fede0b18a81a6fb1acc1a48857f482857c25286
2019-03-25 23:33:48 -04:00
Clayton Coleman 8541248953 Avoid allocations when building SelfLinks and fast path escape
A self link should only require one allocation, and we should skip
url.PathEscape() except when the path actually needs it.

Add a fuzz test to build random strings and verify them against
the optimized implementation. Add a new BenchmarkWatchHTTP_UTF8 that
covers when we have unicode names in the self link.

```
> before
BenchmarkGet-12          	   10000	    118863 ns/op	   17482 B/op	     130 allocs/op
BenchmarkWatchHTTP-12    	   30000	     38346 ns/op	    1893 B/op	      29 allocs/op

> after
BenchmarkGet-12               	   10000	    116218 ns/op	   17456 B/op	     130 allocs/op
BenchmarkWatchHTTP-12         	   50000	     35988 ns/op	    1571 B/op	      26 allocs/op
BenchmarkWatchHTTP_UTF8-12    	   50000	     41467 ns/op	    1928 B/op	      28 allocs/op
```

Saves 3 allocations in the fast path and 1 in the slow path (the
slow path has to build the buffer and then call url.EscapedPath
which always allocates).

Kubernetes-commit: 389a8436b52db4936b56e08f07984da362c91f6b
2019-03-25 18:06:57 -04:00
Kubernetes Publisher f881eae9ec Merge pull request #74321 from yastij/signal-undecorated-storage-event
use cache size to signal undecorated storage

Kubernetes-commit: ec64aef25f2fc8c7f3093d16566e6d2e40b61e4e
2019-03-24 10:52:20 +00:00
Kubernetes Publisher 5eae03fa38 Merge pull request #75570 from smarterclayton/fix_performance
Fix a regression in watch performance and reduce allocations in the GET path

Kubernetes-commit: b3824cd094f73def9d3cdb659f7fab9d855318fe
2019-03-22 22:57:53 +00:00
Clayton Coleman 78a40897c5 Unify runtime.SerializerInfo with negotiate.AcceptedMediaTypes
There was no reason to have two types and this avoids ~10% of allocations
on the GET code path.

```
BenchmarkGet-12          	  100000	    109045 ns/op	   17608 B/op	     146 allocs/op

BenchmarkGet-12          	  100000	    108850 ns/op	   15942 B/op	     132 allocs/op
```

Kubernetes-commit: 0489d0b1cf139253b82f73b072578073bc5616d6
2019-03-21 21:00:55 -04:00
Clayton Coleman 70165311bb Avoid 3 object creations when no dryRun parameter is provided
These allocations should only occur rarely.

```
BenchmarkGet-12          	  100000	    108013 ns/op	   17732 B/op	     149 allocs/op

BenchmarkGet-12          	  100000	    109045 ns/op	   17608 B/op	     146 allocs/op
```

Kubernetes-commit: 59b4f47b225029068bf015117ada1a06d54fbd59
2019-03-21 20:57:36 -04:00
Clayton Coleman f24566b3c2 Avoid an allocation on all requests when checking for an old user agent
ReplaceAllStrings always allocates, while scanning a relatively short
regex twice is slightly more CPU immediately but less later.

```
BenchmarkGet-12          	  100000	    108824 ns/op	   17818 B/op	     152 allocs/op

BenchmarkGet-12          	  100000	    108013 ns/op	   17732 B/op	     149 allocs/op
```

Kubernetes-commit: 83c41eab1d6f55c9ccf61744bfc345c95d3a0664
2019-03-21 20:48:00 -04:00
Clayton Coleman 9006e59e3b IsListType uses reflection and is expensive for hot paths
IsListType was causing ~100 allocations for a non list object. It is
used in a wide range of code, so perform a more targeted check.

The use of `%#v` in a hot return path for `fmt.Errorf()` was the main
victim.

Replace `%#v` with a typed error and create a cache of types that are
lists with a bounded size (probably not necessary, but safer).

```
BenchmarkGet-12          	  100000	    119635 ns/op	   20110 B/op	     206 allocs/op
BenchmarkWatchHTTP-12    	  100000	     65761 ns/op	    7296 B/op	     139 allocs/op

BenchmarkGet-12          	  100000	    109085 ns/op	   17831 B/op	     152 allocs/op
BenchmarkWatchHTTP-12    	  200000	     33966 ns/op	    1913 B/op	      30 allocs/op
```

Kubernetes-commit: 58fb665646aa4c1b63f1322a50e3af7a60e39886
2019-03-21 20:43:26 -04:00
Clayton Coleman dd5dd7ec7e Add benchmark for naive endpoint Get so we can measure it
Baseline:

```
BenchmarkGet-12          	  100000	    119635 ns/op	   20110 B/op	     206 allocs/op
BenchmarkWatchHTTP-12    	  100000	     65761 ns/op	    7296 B/op	     139 allocs/op
```

Kubernetes-commit: 2e1506558ac2c82e83cbef469a6e1e845cfc9235
2019-03-21 20:45:19 -04:00
Kubernetes Publisher 0b35c22017 Merge pull request #75214 from deads2k/health
provide verbose output when health check fails

Kubernetes-commit: 1e184775aab958378bacc6e20723a20571e4ad19
2019-03-22 14:53:32 +00:00