njnu-seafish commented on code in PR #17696:
URL:
https://github.com/apache/dolphinscheduler/pull/17696#discussion_r2575693151
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java:
##########
@@ -105,30 +108,49 @@ public void handle(TaskCallBack taskCallBack) throws
TaskException {
}
String proceduerSql = formatSql(sqlParamsMap, paramsMap);
// call method
- try (CallableStatement stmt =
connection.prepareCall(proceduerSql)) {
+ try (CallableStatement tmpStatement =
connection.prepareCall(proceduerSql)) {
+ sessionStatement = tmpStatement;
// set timeout
- setTimeout(stmt);
+ setTimeout(tmpStatement);
// outParameterMap
- Map<Integer, Property> outParameterMap =
getOutParameterMap(stmt, sqlParamsMap, paramsMap);
+ Map<Integer, Property> outParameterMap =
getOutParameterMap(tmpStatement, sqlParamsMap, paramsMap);
- stmt.executeUpdate();
+ tmpStatement.executeUpdate();
// print the output parameters to the log
- printOutParameter(stmt, outParameterMap);
+ printOutParameter(tmpStatement, outParameterMap);
setExitStatusCode(EXIT_CODE_SUCCESS);
}
} catch (Exception e) {
+ if (exitStatusCode == TaskConstants.EXIT_CODE_KILL) {
+ log.info("procedure task has been killed");
+ return;
+ }
setExitStatusCode(EXIT_CODE_FAILURE);
log.error("procedure task error", e);
throw new TaskException("Execute procedure task failed", e);
}
}
@Override
- public void cancel() throws TaskException {
-
+ public void cancel() {
Review Comment:
> The cancel() method signature was changed to remove the `throws
TaskException` declaration, which is inconsistent with the parent class
AbstractTask that declares `public abstract void cancel() throws
TaskException;`. Even though the implementation throws TaskException on line
148, the signature should maintain the throws declaration for consistency with
the parent class and other task implementations.
ok,good
--
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]