mirror of https://github.com/apache/druid.git
Add logging for task stop operations (#14192)
Log more details when task cannot be stopped for various reasons
This commit is contained in:
parent
1ac5544da7
commit
2086ff88bc
|
@ -145,10 +145,16 @@ public abstract class SeekableStreamIndexTaskClientAsyncImpl<PartitionIdType, Se
|
|||
{
|
||||
return makeRequest(id, new RequestBuilder(HttpMethod.POST, "/stop" + (publish ? "?publish=true" : "")))
|
||||
.onSuccess(r -> true)
|
||||
.onHttpError(e -> Either.value(false))
|
||||
.onNotAvailable(e -> Either.value(false))
|
||||
.onHttpError(e -> {
|
||||
log.warn("Task [%s] coundln't be stopped because of http request failure [%s].", id, e.getMessage());
|
||||
return Either.value(false);
|
||||
})
|
||||
.onNotAvailable(e -> {
|
||||
log.warn("Task [%s] coundln't be stopped because it is not available.", id);
|
||||
return Either.value(false);
|
||||
})
|
||||
.onClosed(e -> {
|
||||
log.debug("Task [%s] couldn't be stopped because it is no longer running.", id);
|
||||
log.warn("Task [%s] couldn't be stopped because it is no longer running.", id);
|
||||
return Either.value(true);
|
||||
})
|
||||
.go();
|
||||
|
|
|
@ -85,7 +85,16 @@ public abstract class SeekableStreamIndexTaskClientSyncImpl<PartitionIdType, Seq
|
|||
publish ? "publish=true" : null,
|
||||
true
|
||||
);
|
||||
return isSuccess(response);
|
||||
boolean isSuccess = isSuccess(response);
|
||||
if (!isSuccess) {
|
||||
log.warn(
|
||||
"Task [%s] coundln't be stopped because of http request failure. Error code [%d], description [%s].",
|
||||
id,
|
||||
response.getStatus().getCode(),
|
||||
response.getStatus().getReasonPhrase()
|
||||
);
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
catch (NoTaskLocationException e) {
|
||||
return false;
|
||||
|
|
|
@ -156,7 +156,7 @@ public class ExecutorLifecycle
|
|||
}
|
||||
|
||||
// Kind of gross, but best way to kill the JVM as far as I know
|
||||
log.info("Triggering JVM shutdown.");
|
||||
log.info("Triggering JVM shutdown. Check overlord logs to see why the task is being shut down.");
|
||||
System.exit(2);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue