klion26 commented on code in PR #4042:
URL: https://github.com/apache/amoro/pull/4042#discussion_r2697320987
##########
amoro-ams/src/main/java/org/apache/amoro/server/DefaultOptimizingService.java:
##########
@@ -543,11 +542,16 @@ private Predicate<TaskRuntime<?>>
buildSuspendingPredication(Set<String> activeT
&& task.getStatus() != TaskRuntime.Status.SUCCESS
|| task.getStatus() == TaskRuntime.Status.SCHEDULED
&& task.getStartTime() + taskAckTimeout <
System.currentTimeMillis()
- || task.getStatus() == TaskRuntime.Status.ACKED
- && task.getStartTime() + taskExecuteTimeout <
System.currentTimeMillis();
+ || isTaskExecTimeout(task);
}
}
+ private boolean isTaskExecTimeout(TaskRuntime<?> task) {
Review Comment:
Thanks for extracting the common logic
##########
amoro-ams/src/main/java/org/apache/amoro/server/AmoroManagementConf.java:
##########
@@ -474,13 +474,14 @@ public class AmoroManagementConf {
.durationType()
.defaultValue(Duration.ofSeconds(30))
.withDescription("Timeout duration for task acknowledgment.");
-
+ // defaultValue must be in nanoseconds; otherwise,
TimeUtils.formatWithHighestUnit will fail with
Review Comment:
IIUC we use `Duration.ofNanos(Long.MAX_VALUE)` instead of
`Duration.ofHours(xx)`(or others) because they will overflow, if this is true,
maybe we don't need this comment, or we can move it to the L482
##########
amoro-ams/src/main/java/org/apache/amoro/server/AmoroManagementConf.java:
##########
@@ -474,13 +474,14 @@ public class AmoroManagementConf {
.durationType()
.defaultValue(Duration.ofSeconds(30))
.withDescription("Timeout duration for task acknowledgment.");
-
+ // defaultValue must be in nanoseconds; otherwise,
TimeUtils.formatWithHighestUnit will fail with
Review Comment:
Could we use the TimeUnit::Second? (may be with Int.MAX_VALUE), Fom my
perspective, seconds are used more often than nanoseconds.
--
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]