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

clear out memory after reads from the dagreader #4525

Merged
merged 2 commits into from
Jan 4, 2018

Conversation

whyrusleeping
Copy link
Member

I would like to figure out how to add a test or two for this. I feel like testing the internals of the dagreader object is a bit pointless, and its pretty difficult to test if something has been garbage collected.

License: MIT
Signed-off-by: Jeromy [email protected]

@ghost ghost assigned whyrusleeping Dec 28, 2017
@ghost ghost added the status/in-progress In progress label Dec 28, 2017
@ghost
Copy link

ghost commented Dec 28, 2017

Maybe a test could add a partial dag, make requests into ranges of it, and then verify we only hold roughly as much memory as we think is appropriate.

@whyrusleeping
Copy link
Member Author

Added a test, another round of review please

}

pbdr := reader.(*pbDagReader)
if pbdr.promises[0] != nil {
Copy link
Member

Choose a reason for hiding this comment

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

What if we checked the correct number of things to be loaded instead?

Copy link
Member

@frrist frrist left a comment

Choose a reason for hiding this comment

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

Minor nit, LGTM.

@whyrusleeping whyrusleeping merged commit 59a8e65 into master Jan 4, 2018
@whyrusleeping whyrusleeping deleted the fix/dagreader-mem branch January 4, 2018 18:11
@ghost ghost removed the status/in-progress In progress label Jan 4, 2018
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.

3 participants