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

GEODE-5897: change create jndi-binding to fail on an exception #2680

Merged
merged 5 commits into from Oct 24, 2018

Conversation

dschneider-pivotal
Copy link
Contributor

@dschneider-pivotal dschneider-pivotal commented Oct 22, 2018

Create jndi-binding will now fail if an exception occurs during the create.
Also the data-source is now validated by asking it for a connection when the jndi-binding is created. If a connection can not be obtained, the create fails and the data-source is closed.
Previously if an exception occurred when creating a jndi-binding an info message was logged.
Now, as the docs state, a warning is logged.

@monkeyherder @BenjaminPerryRoss

Thank you for submitting a contribution to Apache Geode.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

  • Has your PR been rebased against the latest commit within the target branch (typically develop)?

  • Is your initial contribution a single, squashed commit?

  • Does gradlew build run cleanly?

  • Have you written or updated unit tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.

The problem was caused by exception being caught, logged, and not rethrown.
Now the gfsh function will get the thrown exception and pass a failure back
to gfsh. For backwards compatibility, the XML parser still logs a warning if
the jndi-binding can not be created, instead of having it cause the cache not
to start.
when create jndi binding is done in gfsh or xml.
The function that implements create jndi-binding will now log an error
if it fails.
DataSourceCreateException now has a getWrappedException accessor.
Copy link
Member

@sboorlagadda sboorlagadda left a comment

Choose a reason for hiding this comment

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

👍 The change is important and required to make the gfsh command fails rather than asking users to go and logs files. But for cache xml we need to log and ignore the exception to retain existing behaviour.

See https://gemfire.docs.pivotal.io/96/geode/developing/outside_data_sources/configuring_db_connections_using_JNDI.html

 If the data source cannot be bound to JNDI at runtime, GemFire logs a warning.

@dschneider-pivotal
Copy link
Contributor Author

The one failure in integrationTest was a known issue (has a jira ticket) and was not related to this pr.

@dschneider-pivotal dschneider-pivotal merged commit bf7981f into develop Oct 24, 2018
@dschneider-pivotal dschneider-pivotal deleted the feature/GEODE-5897 branch October 24, 2018 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants