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

Conversation

Projects
None yet
3 participants
@dennisoelkers
Member

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 referenced this pull request Jun 8, 2017

Merged

Use aliases for reopened indices #3897

3 of 9 tasks complete

@bernd bernd self-assigned this Jun 8, 2017

@bernd

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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

dennisoelkers commented Jun 12, 2017

Good points!

dennisoelkers added some commits Jun 7, 2017

Making Elasticsearch Version injectable.
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.
Rewriting provider to generic service class.
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

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
graylog-project/pr Jenkins build graylog-project-pr-snapshot 203 has succeeded
Details

@bernd bernd deleted the inject-elasticsearch-version branch Jun 12, 2017

@bernd bernd removed the ready-for-review label Jun 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment