This is an automated email from the ASF dual-hosted git repository.

abhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 2086ff88bc Add logging for task stop operations (#14192)
2086ff88bc is described below

commit 2086ff88bcdbfdba507d52d78bd3c7605beab280
Author: Rishabh Singh <[email protected]>
AuthorDate: Tue May 30 18:50:52 2023 +0530

    Add logging for task stop operations (#14192)
    
    Log more details when task cannot be stopped for various reasons
---
 .../SeekableStreamIndexTaskClientAsyncImpl.java              | 12 +++++++++---
 .../SeekableStreamIndexTaskClientSyncImpl.java               | 11 ++++++++++-
 .../druid/indexing/worker/executor/ExecutorLifecycle.java    |  2 +-
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git 
a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java
 
b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java
index f124ca25ca..2051d807b1 100644
--- 
a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java
+++ 
b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientAsyncImpl.java
@@ -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();
diff --git 
a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientSyncImpl.java
 
b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientSyncImpl.java
index 9f01a6f8c9..971908ac7d 100644
--- 
a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientSyncImpl.java
+++ 
b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClientSyncImpl.java
@@ -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;
diff --git 
a/indexing-service/src/main/java/org/apache/druid/indexing/worker/executor/ExecutorLifecycle.java
 
b/indexing-service/src/main/java/org/apache/druid/indexing/worker/executor/ExecutorLifecycle.java
index b38ac0e2e8..ad46ee7e66 100644
--- 
a/indexing-service/src/main/java/org/apache/druid/indexing/worker/executor/ExecutorLifecycle.java
+++ 
b/indexing-service/src/main/java/org/apache/druid/indexing/worker/executor/ExecutorLifecycle.java
@@ -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);
           }
       );


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to