morrySnow commented on code in PR #18316:
URL: https://github.com/apache/doris/pull/18316#discussion_r1155453785
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/scheduler/SimpleJobScheduler.java:
##########
@@ -27,6 +32,12 @@ public class SimpleJobScheduler implements JobScheduler {
public void executeJobPool(ScheduleContext scheduleContext) {
JobPool pool = scheduleContext.getJobPool();
while (!pool.isEmpty()) {
+ CascadesContext context = (CascadesContext) scheduleContext;
+ Stopwatch watch = context.getStopwatch();
+ // when cost time > 10s. we will stop this job.
+ if (watch.elapsed(TimeUnit.MILLISECONDS) > 10000) {
+ throw new RuntimeException("Nereids cost too much time ( > 10s
)");
+ }
Review Comment:
the StopWatch's doc say
```
Note that the overhead of measurement can be more than a microsecond
```
so, if we have more than 1000 jobs, then the overhead will more than 1
second, and it is unacceptable
refer:
```
https://guava.dev/releases/19.0/api/docs/com/google/common/base/Stopwatch.html
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]