kfaraz commented on code in PR #17816: URL: https://github.com/apache/druid/pull/17816#discussion_r2008713498
########## indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java: ########## @@ -509,30 +507,25 @@ public Response getWorkerConfigHistory( @ResourceFilters(StateResourceFilter.class) public Response doAction(final TaskActionHolder holder) { + final Task task = holder.getTask(); return asLeaderWith( - taskMaster.getTaskActionClient(holder.getTask()), - new Function<>() - { - @Override - public Response apply(TaskActionClient taskActionClient) - { - final Map<String, Object> retMap; - - // It would be great to verify that this worker is actually supposed to be running the task before - // actually doing the action. Some ideas for how that could be done would be using some sort of attempt_id - // or token that gets passed around. - - try { - final Object ret = taskActionClient.submit(holder.getAction()); - retMap = new HashMap<>(); - retMap.put("result", ret); - } - catch (Exception e) { - log.warn(e, "Failed to perform task action"); - return Response.serverError().entity(ImmutableMap.of("error", e.getMessage())).build(); - } - - return Response.ok().entity(retMap).build(); + taskMaster.getTaskActionClient(task), + taskActionClient -> { + try { + final Object result = taskActionClient.submit(holder.getAction()); + return Response.ok().entity(Map.of("result", result)).build(); + } + catch (DruidException e) { + log.noStackTrace().warn( Review Comment: This code has been reverted for now. -- 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: commits-unsubscr...@druid.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org