kfaraz commented on code in PR #16325:
URL: https://github.com/apache/druid/pull/16325#discussion_r1577162226


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/TaskLock.java:
##########
@@ -62,4 +63,17 @@ public interface TaskLock
   boolean isRevoked();
 
   boolean conflict(LockRequest request);
+
+  /**
+   * Checks if the lock is revoked and throws a {@link 
LockAcquisitionFailedException} if so.
+   *
+   * @param interval The time interval for which the lock is acquired.
+   * @throws LockAcquisitionFailedException if the lock is revoked.
+   */
+  default void assertNotRevoked(Interval interval)
+  {
+    if (isRevoked()) {
+      throw new LockAcquisitionFailedException(interval);

Review Comment:
   I think it would be better to throw a `DruidException` instead.



##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java:
##########
@@ -424,15 +426,16 @@ private void manageInternalCritical(
           catch (Exception e) {
             log.warn(e, "Exception thrown during isReady for task: %s", 
task.getId());
             final String errorMessage;
-            if (e instanceof MaxAllowedLocksExceededException) {
+            if (e instanceof MaxAllowedLocksExceededException || e instanceof 
LockAcquisitionFailedException) {
               errorMessage = e.getMessage();
             } else {
               errorMessage = StringUtils.format(
-                  "Encountered error[%s] while waiting for task to be ready. 
See Overlord logs for more details.",
-                  StringUtils.chop(e.getMessage(), 100)
+                  "Encountered error while waiting for task to be ready. See 
Overlord logs for more details. Error: %s",
+                  Throwables.getStackTraceAsString(e)

Review Comment:
   +1, I prefer the old message here. (We can still remove the truncation limit 
of 100 though as it is already being handled inside `TaskStatus`.)
   
   We are already giving out the info that the task could not become ready and 
some error occurred. That is enough info for an end user. After that, it is up 
to the admin/operator to look at the logs to know the complete stack trace.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to