Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
Signed-off-by: shuming.li <[email protected]>
  • Loading branch information
LiShuMing committed Oct 11, 2024
1 parent 76585cc commit 588bde6
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.apache.commons.lang3.NotImplementedException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.util.Strings;
import org.apache.thrift.meta_data.FieldValueMetaData;
import org.apache.thrift.protocol.TType;

Expand Down Expand Up @@ -210,14 +211,18 @@ public static TGetTaskRunInfoResult query(TGetTasksParams params) {
info.setState(status.getState().toString());
info.setCatalog(status.getCatalogName());
info.setDatabase(ClusterNamespace.getNameFromFullName(status.getDbName()));
try {
// NOTE: use task's definition to display task-run's definition here
Task task = taskManager.getTaskWithoutLock(taskName);
if (task != null) {
info.setDefinition(task.getDefinition());
if (!Strings.isEmpty(status.getDefinition())) {
info.setDefinition(status.getDefinition());
} else {
try {
// NOTE: use task's definition to display task-run's definition here
Task task = taskManager.getTaskWithoutLock(taskName);
if (task != null) {
info.setDefinition(task.getDefinition());
}
} catch (Exception e) {
LOG.warn("Get taskName {} definition failed: {}", taskName, e);
}
} catch (Exception e) {
LOG.warn("Get taskName {} definition failed: {}", taskName, e);
}
info.setError_code(status.getErrorCode());
info.setError_message(status.getErrorMessage());
Expand Down

0 comments on commit 588bde6

Please sign in to comment.