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

Fix driver class loading #356

Merged
merged 2 commits into from
Oct 25, 2019
Merged

Conversation

robbavey
Copy link
Contributor

The changes to class loading intended to fix usage of :jdbc_driver_library with
Java 11, introduced in v4.3.14, appear to have some issues
(elastic/logstash#11268, #355). This commit attempts
to resolve those issues, and reworks the integration tests to work with
docker and ensure that the :jdbc_driver_library configuration option works.

This has been tested with postgresql using Java 8 and Java 11.

The changes to class loading intended to fix usage of :jdbc_driver_library with
Java 11, introduced in `v4.3.14`, appear to have some issues
(elastic/logstash#11268, logstash-plugins#355). This commit attempts
to resolve those issues, and reworks the integration tests to work with
docker and ensure that the :jdbc_driver_library configuration option works.

This has been tested with postgresql using Java 8 and Java 11.
@elasticsearch-bot elasticsearch-bot self-assigned this Oct 25, 2019
Copy link
Contributor

@yaauie yaauie left a comment

Choose a reason for hiding this comment

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

The fix seems deceptively simple, but seems to go with the grain of jruby better than the alternatives.

I've left one comment about whether validating the resolution of a provided@jdbc_driver_class is in scope for this PR.

lib/logstash/plugin_mixins/jdbc/jdbc.rb Show resolved Hide resolved
@robbavey robbavey merged commit 23e6e3b into logstash-plugins:master Oct 25, 2019
robbavey added a commit to robbavey/logstash-filter-jdbc_streaming that referenced this pull request Oct 28, 2019
Making the same fix to driver loading that was applied to the JDBC
input in logstash-plugins/logstash-input-jdbc#356

This commit also reworks the test to force driver loading in the
integration tests by removing the postgres gem as a dependency and
doing all the database setup work in an external sql script)

This fixes logstash-plugins#34 (the fix previously applied in logstash-plugins#31 did not work correctly)
elasticsearch-bot pushed a commit to logstash-plugins/logstash-filter-jdbc_streaming that referenced this pull request Oct 29, 2019
Making the same fix to driver loading that was applied to the JDBC
input in logstash-plugins/logstash-input-jdbc#356

This commit also reworks the test to force driver loading in the
integration tests by removing the postgres gem as a dependency and
doing all the database setup work in an external sql script)

This fixes #34 (the fix previously applied in #31 did not work correctly)

Fixes #35
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.

3 participants