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 indexer connectivity check by catching the correct exception type #14063

Merged
merged 6 commits into from Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/unreleased/pr-14063.toml
@@ -0,0 +1,4 @@
type = "fixed"
message = "Fix connectivity check when Elasticsearch/OpenSearch is not available."

pulls = ["14063"]
Expand Up @@ -168,7 +168,7 @@ public boolean isConnected() {
try {
final ClusterHealthResponse result = client.execute((c, requestOptions) -> c.cluster().health(request, requestOptions));
return result.getNumberOfDataNodes() > 0;
} catch (ElasticsearchException e) {
} catch (org.graylog.shaded.elasticsearch7.org.elasticsearch.ElasticsearchException e) {
if (LOG.isDebugEnabled()) {
LOG.error(e.getMessage(), e);
}
Expand Down
Expand Up @@ -169,7 +169,7 @@ public boolean isConnected() {
try {
final ClusterHealthResponse result = client.execute((c, requestOptions) -> c.cluster().health(request, requestOptions));
return result.getNumberOfDataNodes() > 0;
} catch (ElasticsearchException e) {
} catch (OpenSearchException e) {
if (LOG.isDebugEnabled()) {
LOG.error(e.getMessage(), e);
}
Expand Down