Skip to content

Commit 6505439

Browse files
committed
Add better logging to write request
Signed-off-by: Brian Flores <[email protected]>
1 parent 96031d0 commit 6505439

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsAction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,22 +228,22 @@ private void bulkSetModelIndexToUndeploy(
228228
}
229229

230230
bulkUpdateRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
231-
log.info("No nodes service: {}", Arrays.toString(modelIds));
231+
log.info("No nodes running these models: {}", Arrays.toString(modelIds));
232232

233233
try (ThreadContext.StoredContext threadContext = client.threadPool().getThreadContext().stashContext()) {
234234
ActionListener<MLUndeployModelsResponse> listenerWithContextRestoration = ActionListener
235235
.runBefore(listener, () -> threadContext.restore());
236236
ActionListener<BulkResponse> bulkResponseListener = ActionListener.wrap(br -> {
237-
log.debug("Successfully set modelIds to UNDEPLOY in index");
237+
log.debug("Successfully set the following modelId(s) to UNDEPLOY in index: {}", Arrays.toString(modelIds));
238238
listenerWithContextRestoration.onResponse(new MLUndeployModelsResponse(response));
239239
}, e -> {
240-
log.error("Failed to set modelIds to UNDEPLOY in index", e);
240+
log.error("Failed to set the following modelId(s) to UNDEPLOY in index: {}", Arrays.toString(modelIds), e);
241241
listenerWithContextRestoration.onFailure(e);
242242
});
243243

244244
client.bulk(bulkUpdateRequest, bulkResponseListener);
245245
} catch (Exception e) {
246-
log.error("Unexpected error while setting modelIds to UNDEPLOY status to index", e);
246+
log.error("Unexpected error while setting the following modelId(s) to UNDEPLOY in index: {}", Arrays.toString(modelIds), e);
247247
listener.onFailure(e);
248248
}
249249

0 commit comments

Comments
 (0)