Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.8 backports 2020-10-09 #13486

Merged
merged 8 commits into from
Oct 13, 2020
Merged

v1.8 backports 2020-10-09 #13486

merged 8 commits into from
Oct 13, 2020

Conversation

qmonnet
Copy link
Member

@qmonnet qmonnet commented Oct 9, 2020

Once this PR is merged, you can update the PR labels via:

$ for pr in 13450 13471 13472 13452; do contrib/backporting/set-labels.py $pr done 1.8; done

tgraf and others added 8 commits October 9, 2020 14:41
[ upstream commit ecb2369 ]

The following log message was duplicated and printed twice for two
different meanings.

Fixes: 3141e65 ("rate: Add API rate limiting system")
Signed-off-by: Thomas Graf <thomas@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit 208c69c ]

So far, the rate limiting has been enforced before enforcing parallel
requests. In theory, this is better because we can return error code
429 earlier to tell callers to slow down.

In practice, many callers will retry immediately anyway which means that
all the limiting will happen by the rate limiter. The rate limiter
relies on reservations that need to be canceled. If too many requests
happen in parallel, reservations can't be canceled quickly enough.

By swapping the enforcement of parallel requests with the rate limiter,
all requests will block for at least MaxWaitDuration if more than the
allowed number of parallel requests are pending which will naturally
pace the callers.

Swapping the enforcement order requires the acquired semaphore to be
released in error cases of the rate limiter. This requires to change the
structure of Wait() to have a single error handling structure. By
reusing finishRequest(), the metrics handler has to be adjusted slightly
to account for new outcomes as it now bumps the metric for canceled
requests as well. What remains unchanged is that only successful API
requests are used to calculate the mean processing duration.

Fixes: 3141e65 ("rate: Add API rate limiting system")
Signed-off-by: Thomas Graf <thomas@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit 75159c6 ]

Simulate stress by feeding many parallel requests through the API rate
limiter. The maximum wait duration will soon be hit for requests causing
them to fail.

Without the fix, this test would often fail. If it succeeded, the number
of retries is in the range of 60-80K. With the fix, the test succeeds
consistently and retries are in the range of 6-8K. That's a 10x
reduction of retries.

Signed-off-by: Thomas Graf <thomas@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit 269aa1b ]

Test that failing requests will not impact the rate limiter. This is
already working correctly so this test only adds additional coverage.

Signed-off-by: Thomas Graf <thomas@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit 30160bc ]

If both Spec and Specs are considered the same we don't need to re-add
the CNP into the policy repository. The commit 134fdb5 should have
added the Specs.DeepEqual and not remove the Spec.DeepEqual.

Fixes: 134fdb5 ("k8s/watchers: fix missing missing CNP/CCNP updates")
Signed-off-by: André Martins <andre@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit 94ddcd3 ]

MapStringEqualsIgnoreKeys will be used to compare maps while ignoring
certain keys.

Signed-off-by: André Martins <andre@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit bafc881 ]

An equal function should never modify its fields, by doing it so it
might cause race conditions.

Fixes: 100d83c ("k8s: ignore kubectl.kubernetes.io/last-applied-configuration annotation")
Signed-off-by: André Martins <andre@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit 837caf8 ]

- Use k8s secret key name 'ca.crt' for 'ca-certificates.crt' so that the example CNP works
- Change the example monitor output from lyft.com to artii.herokuapp.com
- Add deletion of the secrets to clean-up
- Fix indentation and white-spacing in enumerated lists so that they are rendered properly

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
@qmonnet qmonnet requested a review from a team as a code owner October 9, 2020 14:08
@qmonnet qmonnet added backport/1.8 kind/backports This PR provides functionality previously merged into master. labels Oct 9, 2020
@qmonnet
Copy link
Member Author

qmonnet commented Oct 9, 2020

test-backport-1.8

Copy link
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My changes LGTM

@tklauser tklauser merged commit 9a17339 into v1.8 Oct 13, 2020
@tklauser tklauser deleted the pr/v1.8-backport-2020-10-09 branch October 13, 2020 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/backports This PR provides functionality previously merged into master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants