fix(grpc/exec): fix RefDec in exit's eventcache path #4593
+29
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes
Description
Make the exit eventcache path mirror the exec path with respect to refcount ops.
When events get kicked to the eventcache, they will be retried a certain number of times to see if pod/parent info has become available. There are 2 methods for retrying:
RetryInternal()andRetry(), which are interfaces.RetryInternal()is sometimes called beforeRetry(), depending on the circumstances.For exec, we have the
parent.RefInc("parent")being called in Retry(), after the pod info check. In exit, we haveparent.RefDec("parent")called in RetryInternal() before the pod info check that happens inRetry(), which in the exit event's case just happens to be a call toeventcache.HandleGenericEvent.Make the exit path balance with the exec path in that it should only call
parent.RefDec("parent")after it's confirmed that pod and parent info is present.Results
Before Fix
After Fix
This is the workload that was used to generate these metrics:
Changelog