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

Explicitly release resources in LogFileReader and TestHoodieClientBase. Fixes Memory allocation errors #463

Merged
merged 1 commit into from Sep 20, 2018

Conversation

bvaradar
Copy link
Contributor

@bvaradar bvaradar commented Sep 19, 2018

Some Context HERE:

Issue : #462

There were 2 issues here :

  1. Cannot allocate Memory:
    Our maven surefire configs causes one JVM forked process to run all tests in a single module serially.
    Looking at different test logs where memory allocation failed, it was clear the issue is happening only when running tests in hoodie-client.
    Did some divide-n-conquer in localizing the tests by looking at Yourkit profile results and opening some dummy PRs which selectively disables some suspects ( https://github.com/bvaradar/hudi/pulls ). Was able to localize by disabling some of the tests which allowed the tests to pass in TravisCI.

The base-test class TestHoodieClientBase which sets up each HoodieClient tests and TestMergeOnReadTable was leaking resources. Part of the PR fixes this.

  1. Seeing Exception : FileSystemClosed when the JVM terminates.
    This is caused by unchecked close of inputStream in HoodieLogReader. Also, found that we have not properly handled closing of HoodieLogFormatReader (which encapsulates multiple log file reading). I had updated the code to explicitly call close() at different LogFileReader abstractions and also made all the unit-tests properly close the log-file readers they were using. This fixed the "FileSystem closed" exceptions we were seeing in unit-tests.

@bvaradar
Copy link
Contributor Author

bvaradar commented Sep 19, 2018

@n3nash @vinothchandar : PR to make master green.

Unit tests passes with this PR in Travis CI

@bvaradar bvaradar changed the title [WIP] Explicitly release resources in LogFileReader and TestHoodieClientBase. Fixes Memory allocation errors Explicitly release resources in LogFileReader and TestHoodieClientBase. Fixes Memory allocation errors Sep 20, 2018
@bvaradar
Copy link
Contributor Author

Thanks @n3nash @vinothchandar for doing a quick review. I have addressed/Replied-to your review comments. Please take a look.

@n3nash
Copy link
Contributor

n3nash commented Sep 20, 2018

LGTM

Copy link
Contributor Author

@bvaradar bvaradar left a comment

Choose a reason for hiding this comment

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

@vinothchandar : Addressed your comment regarding tearDown

@vinothchandar vinothchandar merged commit 5cb28e7 into apache:master Sep 20, 2018
@bvaradar bvaradar deleted the fix_failure branch September 20, 2018 15:51
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.

None yet

3 participants