kubernetes / apiserver

Library for writing a Kubernetes-style API server.
Apache License 2.0
654 stars 406 forks source link

mutating requests time out when apiserver has not received any mutating requests in a long time #58

Closed staebler closed 4 years ago

staebler commented 4 years ago

When it has been a long time (ie, hours) since an apiserver has received any mutating requests, then the next mutating request can take too long to perform observations on mutating requests in the max-in-flight filter.

The following code has to loop over many, many elements. https://github.com/kubernetes/apiserver/blob/v0.19.0/pkg/util/flowcontrol/metrics/sample_and_watermark.go#L185-L191

staebler commented 4 years ago

@MikeSpreitzer Would it be appropriate to do a similar fix to what was was done in https://github.com/kubernetes/apiserver/commit/b1ede52e216baf0bf245cba1107442e5b102b694 for the histograms in the max-in-flight filter?

staebler commented 4 years ago

Sorry, I realize now that this issue should have been submitted to https://github.com/kubernetes/kubernetes. I created https://github.com/kubernetes/kubernetes/issues/95300.