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

LuceneSearcher redesign and fix memory leak #8112

Merged
merged 30 commits into from
Feb 5, 2018
Merged

Conversation

skabashnyuk
Copy link
Contributor

@skabashnyuk skabashnyuk commented Jan 2, 2018

What does this PR do?

LuceneSearcher redesign and fix memory leak

  • org.eclipse.che.api.search.server.Searcher reworked exceptions. Instead of transport exceptions, it will throw search specific exceptions.
  • OffsetData moved to separate class, outside from LuceneSearcher.
  • QueryExpression and OffsetData now on the same level as Searcher interface
  • Used dedicated one-time used demon thread for initial indexing instead of thread pool
  • Added CountDownLatch to test if initial indexing complete.
  • Removed dependency on org.eclipse.jface.text in offset calculation
  • Used Files.walkFileTree to simplify add directory method
  • added printStatistic method to put some statistics in log.debug output
  • optimized delete method to the fact that is called after folder or file removal
  • Called indexWriter.commit after adding, update, removal of file or folder
  • Added implementation agnostic test for org.eclipse.che.api.search.server.Searcher
  • Added specific to LuceneSearche test

What issues does this PR fix or reference?

Fixes #8111

Release Notes

LuceneSearcher redesign and fix memory leak

Docs PR

n/a

@benoitf benoitf added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/bug Outline of a bug - must adhere to the bug report template. labels Jan 2, 2018
@skabashnyuk skabashnyuk changed the title [WP] LuceneSearcher redesign and fix memory leak LuceneSearcher redesign and fix memory leak Jan 2, 2018

@BeforeMethod
public void setUp() throws Exception {
indexDirectory = Files.createTempDir(); // Paths.get("/tmp/indexdir").toFile();

Choose a reason for hiding this comment

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

Is this comment needed?

@@ -680,7 +692,7 @@ public ProjectSearchResponseDto search(ProjectSearchRequestDto request) {

try {
return search(path, name, text, maxItems, skipCount);
} catch (ServerException | ConflictException | NotFoundException | ForbiddenException e) {
} catch (ServerException | NotFoundException | BadRequestException e) {

Choose a reason for hiding this comment

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

Not sure it makes sense to throw these exceptions in other code to lose the information about exception type here.

@skabashnyuk
Copy link
Contributor Author

ci-test

@codenvy-ci
Copy link

codenvy-ci commented Jan 6, 2018

ci-test build report:
Build details
Test report
selenium tests report data
docker image: riuvshin/che-server:8112
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@skabashnyuk
Copy link
Contributor Author

ci-test

@codenvy-ci
Copy link

codenvy-ci commented Jan 8, 2018

ci-test build report:
Build details
Test report
selenium tests report data
docker image: riuvshin/che-server:8112
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@skabashnyuk
Copy link
Contributor Author

ci-test

@eclipse-che eclipse-che deleted a comment from codenvy-ci Jan 11, 2018
@eclipse-che eclipse-che deleted a comment from codenvy-ci Jan 11, 2018
@eclipse-che eclipse-che deleted a comment from codenvy-ci Jan 11, 2018
@eclipse-che eclipse-che deleted a comment from codenvy-ci Jan 11, 2018
@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:8112
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@skabashnyuk
Copy link
Contributor Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:8112
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@skabashnyuk
Copy link
Contributor Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:8112
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@mkuznyetsov
Copy link
Contributor

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:8112
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@mkuznyetsov mkuznyetsov merged commit 70b87d7 into master Feb 5, 2018
@mkuznyetsov mkuznyetsov deleted the reworkindexsearcher branch February 5, 2018 12:46
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Feb 5, 2018
@benoitf benoitf added this to the 6.1.0 milestone Feb 5, 2018
@skabashnyuk skabashnyuk mentioned this pull request Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak during removal of document from Lucene index
7 participants