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 indexer connectivity check by catching the correct exception type #14063
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not affecting OpenSearch? From what I can see, the OS code throws a org.graylog.shaded.opensearch2.org.opensearch.OpensearchException
, but a org.graylog2.indexer.OpensearchException
is caught, just similar to the ES-code?
@dennisoelkers I think the corresponding class for OpenSearch 2 needs a change, too. I probably did not find this, because I replaced the shaded imports with new ones. @thll Would you both mind if I push a change to this PR for OpenSearch? |
Not at all. Go ahead! I thought I tried it with OpenSearch and didn't see the issue, but something else probably was at play. |
I'll check with OpenSearch again. But from my experience so far, I'm very sure that changing the exception in the OpenSearch 2 adapter makes more sense than keeping it as it was because the adapter is the changed ES7 adapter |
I know what I did wrong. I tested with OpenSearch Tried again with OpenSearch 2 and can confirm that it was also broken. |
This reverts commit 9c61eae.
…#14063) (#14076) * Fix connectivity check by catching the correct exception type * add changelog * Fix typo * added changes for OpenSearch Adapter * add changelog * Revert "add changelog" This reverts commit 9c61eae. Co-authored-by: Jan Heise <jan.heise@graylog.com> (cherry picked from commit 9bb27f5)
…#14063) (#14075) * Fix connectivity check by catching the correct exception type * add changelog * Fix typo * added changes for OpenSearch Adapter * add changelog * Revert "add changelog" This reverts commit 9c61eae. Co-authored-by: Jan Heise <jan.heise@graylog.com> (cherry picked from commit 9bb27f5) Co-authored-by: Jan Heise <jan.heise@graylog.com>
The connectivity check for ES [Edit: and OpenSearch] was handling the wrong exception so that all calls to
#isConnected
would result in an exception when the ES cluster was not reachable.This only affected Elasticsearch, not OpenSearch.This PR fixes that by catching the correct exception type.
To see the effect, sever the connection to ES while the server is running.
Before the change, the server log will be filled with a lot messages from the
IndexFieldTypePollerPeriodical
like these:After the change, for the
IndexFieldTypePollerPeriodical
, there will be just a single line logged:Graylog Version:
5.1.0-SNAPSHOT