kfaraz commented on code in PR #16325:
URL: https://github.com/apache/druid/pull/16325#discussion_r1578759260
##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java:
##########
@@ -424,15 +424,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
DruidException) {
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 [%s] while waiting for task to be ready.
See Overlord logs for more details.",
Review Comment:
Nit: Druid message formatting style does not use the space before the
brackets.
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/TaskLock.java:
##########
@@ -62,4 +63,18 @@ public interface TaskLock
boolean isRevoked();
boolean conflict(LockRequest request);
+
+ /**
+ * Checks if the lock is revoked and throws a {@link DruidException} if so.
+ *
+ * @throws DruidException if the lock is revoked.
+ */
+ default void assertNotRevoked()
+ {
+ if (isRevoked()) {
+ throw DruidException.forPersona(DruidException.Persona.OPERATOR)
+ .ofCategory(DruidException.Category.RUNTIME_FAILURE)
+ .build("Lock for interval [%s] was revoked", getInterval());
Review Comment:
Nit: Druid message formatting style. Should we include lock type and version
in the message too?
```suggestion
.build("Lock for interval[%s] was revoked", getInterval());
```
--
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]