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

plugin/kubernetes: remove skipApiCleanup boolean #4244

Closed
wants to merge 2 commits into from
Closed

Conversation

miekg
Copy link
Member

@miekg miekg commented Oct 28, 2020

Signed-off-by: Miek Gieben miek@miek.nl

Signed-off-by: Miek Gieben <miek@miek.nl>
Copy link
Member

@chrisohaver chrisohaver left a comment

Choose a reason for hiding this comment

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

IIRC, you had originally added the clean up step at the end of the To functions to help with memory footprint reduction.

@chrisohaver
Copy link
Member

IIRC, you had originally added the clean up step at the end of the To functions to help with memory footprint reduction.

Presumably because the object is still referenced by the informer, so “zeroing” it out at least gets the things it referenced to be GCd. (I’m just presuming. I don’t know for sure)

@miekg
Copy link
Member Author

miekg commented Oct 28, 2020 via email

@miekg
Copy link
Member Author

miekg commented Oct 28, 2020

yes, zeroing those values makes tests fail; this means that those tests are using code that's not used in prod.

I'm not sure who much memory we are saving with doing this, or if it can be GCed... ?

@chrisohaver
Copy link
Member

yes, zeroing those values makes tests fail; this means that those tests are using code that's not used in prod.

I'm not sure who much memory we are saving with doing this, or if it can be GCed... ?

FWIW, I think this is the squashed commit message for adding that (from 830e97f#diff-642b4aa397e466d410076c727182863bf09f5724a41f20ad14431bc3e86599ae)...

* Set incoming object to nil

Explicataliy discard the converted object; we did a deep copy it's
not needed anymore.

Signed-off-by: Miek Gieben <miek@miek.nl>

Unclear if it was done based on test results.

@chrisohaver
Copy link
Member

... and the PR comment: #2128 (comment)

@miekg
Copy link
Member Author

miekg commented Oct 28, 2020 via email

@chrisohaver
Copy link
Member

chrisohaver commented Oct 28, 2020

Actually - running through the PR conversation - it looks like memory footprint shrank significantly with this change.
footprint reduced by 10% prior to nilling, and then 27%/32% with the nilling.

Signed-off-by: Miek Gieben <miek@miek.nl>
@miekg
Copy link
Member Author

miekg commented Oct 28, 2020 via email

@chrisohaver
Copy link
Member

chrisohaver commented Oct 28, 2020

Then we left with the question that tests need a flag the specifically changes how production works. I don't think that are good tests.

It's not ideal, but I think better than not having tests at all.

The valid concern is that the latency metric feature itself (not just the tests) might depend on the original api objects being left intact.

The original defense of adding the skipCleanup boolean, is a bit vague on precisely why this is needed. Unclear if it's an artifact of how the fakeClient cache operates.

We might need to test this in coredns/ci ... in the kubernetes cluster tests. We would not be able to check for specific latency values, like we do in these unit tests, but we could test that the metric produces "something reasonable". Or perhaps we could if we manually modify the endpoint annotations (assuming that doesn't break stuff).

@miekg
Copy link
Member Author

miekg commented Oct 28, 2020 via email

miekg added a commit that referenced this pull request Nov 2, 2020
This was purely added to facilitate some testing, meaning the tests
don't test production code.

Remove the metrics and informer tests, these should be moved to
coredns/ci to be properly e2e tested.

Closes: #4244

Signed-off-by: Miek Gieben <miek@miek.nl>
@miekg miekg closed this Nov 5, 2020
@miekg miekg deleted the remove-bool branch November 5, 2020 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants