Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Lou <mloufra@amazon.com>
  • Loading branch information
mloufra committed Jan 4, 2023
1 parent a25a306 commit 8d061db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/opensearch/sdk/ExtensionsRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CancellationException;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;

Expand Down Expand Up @@ -416,7 +415,9 @@ public List<DiscoveryExtensionNode> sendExtensionDependencyRequest(TransportServ
// Wait on Extension Dependency response
extensionDependencyResponseHandler.awaitResponse();
} catch (TimeoutException e) {
logger.warn("Failed to send Extension Dependency request to OpenSearch", e);
logger.info("Failed to receive Extension Dependency response from OpenSearch", e);
} catch (Exception e) {
logger.info("Failed to send Extension Dependency request to OpenSearch", e);
}

// At this point, response handler has read in the extension dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.io.IOException;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

import org.apache.logging.log4j.LogManager;
Expand All @@ -39,7 +38,6 @@ public ExtensionDependencyResponseHandler() {

@Override
public void handleResponse(ExtensionDependencyResponse response) {
logger.info("received {}", response);

// Set cluster state from response
this.extensions = response.getExtensionDependencies();
Expand All @@ -48,7 +46,7 @@ public void handleResponse(ExtensionDependencyResponse response) {

@Override
public void handleException(TransportException exp) {
logger.info("ExtensionDependencyRequest failed", exp);
logger.info("ExtensionDependencyResponseHandler failed", exp);
inProgressFuture.completeExceptionally(exp);
}

Expand All @@ -65,7 +63,9 @@ public ExtensionDependencyResponse read(StreamInput in) throws IOException {
/**
* Invokes await on the ExtensionDependencyResponseHandler count down latch
* @throws Exception
* if the response times out
* if the response times out,
* if the response has been cancelled
* if the response failed
*/
public void awaitResponse() throws Exception {
inProgressFuture.orTimeout(ExtensionsManager.EXTENSION_REQUEST_WAIT_TIMEOUT, TimeUnit.SECONDS);
Expand Down

0 comments on commit 8d061db

Please sign in to comment.