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

Making Elasticsearch Version injectable. #3896

Merged
merged 7 commits into from Jun 12, 2017
Merged

Conversation

@dennisoelkers
Copy link
Member

@dennisoelkers dennisoelkers commented Jun 7, 2017

Description

Motivation and Context

This allows us to reuse the mechanism of retrieving the version of the
connected Elasticsearch nodes in other parts of the code besides the
IndexMappingFactory.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
@dennisoelkers dennisoelkers added this to the 2.3.0 milestone Jun 7, 2017
@dennisoelkers dennisoelkers mentioned this pull request Jun 8, 2017
3 of 9 tasks
@bernd bernd self-assigned this Jun 8, 2017
Copy link
Member

@bernd bernd left a comment

We should not do IO during injection but always inject a Provider<ElasticsearchVersion> instead. Otherwise we will run into weird injection errors when Elasticsearch is not reachable or any other exception is thrown in the provider.

@kroepke
Copy link
Member

@kroepke kroepke commented Jun 9, 2017

Ideally we would never do any IO in providers, because the user is not necessarily aware that the injection might fail (and it might fail multiple times, block indefinitely, or otherwise throw exceptions).

It is greatly preferable to inject something that gives you a service that can be used to retrieve the information, because then the user will see a TimeoutException etc being declared.

@dennisoelkers
Copy link
Member Author

@dennisoelkers dennisoelkers commented Jun 12, 2017

Good points!

This allows us to reuse the mechanism of retrieving the version of the
connected Elasticsearch nodes in other parts of the code besides the
IndexMappingFactory.
This prevents I/O being done during injection, which could cause to
erratic and intransparent startup behavior in case of errors.
@dennisoelkers dennisoelkers force-pushed the inject-elasticsearch-version branch from 5ff5028 to 57de82d Jun 12, 2017
@bernd
bernd approved these changes Jun 12, 2017
@bernd bernd merged commit ad4ae5d into master Jun 12, 2017
4 checks passed
4 checks passed
@garybot2
ci-web-linter Jenkins build graylog-pr-linter-check 1725 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@garybot2
graylog-project/pr Jenkins build graylog-project-pr-snapshot 203 has succeeded
Details
@bernd bernd deleted the inject-elasticsearch-version branch Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants