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

Potential REST Connection Leak in InitializationUtils #883

Closed
jbaiera opened this issue Oct 26, 2016 · 0 comments
Closed

Potential REST Connection Leak in InitializationUtils #883

jbaiera opened this issue Oct 26, 2016 · 0 comments

Comments

@jbaiera
Copy link
Member

jbaiera commented Oct 26, 2016

In certain cases, a call to checkIndexExistence may leak a client connection:

https://github.com/elastic/elasticsearch-hadoop/blob/master/mr/src/main/java/org/elasticsearch/hadoop/rest/InitializationUtils.java#L259-L271

This occurs if the following situations are satisfied:

  1. The client object passed in is null.
  2. es.index.auto.create is set to false (away from the default true value).
  3. The write index exists.
  4. The client closing method is skipped over.
  5. Newly created client object does not close it's resources.

While this is most likely not a problem on most of the integrations, it may pose an issue for long lived tasks.

@jbaiera jbaiera closed this as completed in c239baf Nov 3, 2016
jbaiera added a commit that referenced this issue Nov 3, 2016
Mismanagement of a RestRepository connection would occur if no connection was passed to the check, the index auto create was disabled, and the index already exists upon check.
Fixes #883
@jbaiera jbaiera added the v5.0.1 label Nov 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant