Skip to content

Commit 77f6e5b

Browse files
committed
Add better logging to write request
Signed-off-by: Brian Flores <[email protected]>
1 parent 46363ef commit 77f6e5b

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
@@ -205,22 +205,22 @@ private void bulkSetModelIndexToUndeploy(
205205
}
206206

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

210210
try (ThreadContext.StoredContext threadContext = client.threadPool().getThreadContext().stashContext()) {
211211
ActionListener<MLUndeployModelsResponse> listenerWithContextRestoration = ActionListener
212212
.runBefore(listener, () -> threadContext.restore());
213213
ActionListener<BulkResponse> bulkResponseListener = ActionListener.wrap(br -> {
214-
log.debug("Successfully set modelIds to UNDEPLOY in index");
214+
log.debug("Successfully set the following modelId(s) to UNDEPLOY in index: {}", Arrays.toString(modelIds));
215215
listenerWithContextRestoration.onResponse(new MLUndeployModelsResponse(response));
216216
}, e -> {
217-
log.error("Failed to set modelIds to UNDEPLOY in index", e);
217+
log.error("Failed to set the following modelId(s) to UNDEPLOY in index: {}", Arrays.toString(modelIds), e);
218218
listenerWithContextRestoration.onFailure(e);
219219
});
220220

221221
client.bulk(bulkUpdateRequest, bulkResponseListener);
222222
} catch (Exception e) {
223-
log.error("Unexpected error while setting modelIds to UNDEPLOY status to index", e);
223+
log.error("Unexpected error while setting the following modelId(s) to UNDEPLOY in index: {}", Arrays.toString(modelIds), e);
224224
listener.onFailure(e);
225225
}
226226

0 commit comments

Comments
 (0)