vigneshio commented on code in PR #4962:
URL: https://github.com/apache/polaris/pull/4962#discussion_r3554311641
##########
runtime/service/src/main/java/org/apache/polaris/service/task/TaskExecutorImpl.java:
##########
@@ -229,35 +230,33 @@ protected void handleTask(
.addKeyValue("taskEntityId", taskEntityId)
.addKeyValue("taskType", task.getTaskType())
.log("Unable to find handler for task type");
- throw new RuntimeException(
+ throw new TaskHandlerNotFoundException(
"Unable to find handler for task type "
+ task.getTaskType()
+ " for task entity id "
+ taskEntityId);
}
TaskHandler handler = handlerOpt.get();
- success = handler.handleTask(task, ctx);
- if (success) {
- LOGGER
- .atInfo()
- .addKeyValue("taskEntityId", taskEntityId)
- .addKeyValue("handlerClass", handler.getClass())
- .log("Task successfully handled");
- metaStoreManager.dropEntityIfExists(
- ctx.getPolarisCallContext(), null, taskEntity, Map.of(), false);
- } else {
- LOGGER
- .atWarn()
- .addKeyValue("taskEntityId", taskEntityId)
- .addKeyValue("taskEntityName", taskEntity.getName())
- .log("Unable to execute async task");
- throw new RuntimeException(
- "Task handler returned false for task entity id "
- + taskEntityId
- + " (handler: "
- + handler.getClass().getSimpleName()
- + ")");
- }
+ handler.handleTask(task, ctx);
+ success = true;
+ LOGGER
+ .atInfo()
+ .addKeyValue("taskEntityId", taskEntityId)
+ .addKeyValue("handlerClass", handler.getClass())
+ .log("Task successfully handled");
+ metaStoreManager.dropEntityIfExists(
+ ctx.getPolarisCallContext(), null, taskEntity, Map.of(), false);
+ } catch (TaskHandlerNotFoundException e) {
+ success = false;
Review Comment:
Dropped the no-op` `success = false``. Catch stays only to rethrow without
the generic failure log..
--
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]