You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morrySnow (via GitHub)" <gi...@apache.org> on 2023/04/03 03:37:25 UTC
[GitHub] [doris] morrySnow commented on a diff in pull request #18316: [feature](Nereids): when cost time > 10s, throw timeout Exception
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
--
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-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org