branch-2.1: [opt](log) add more info in nereids timeout log #45705 (#45793)

cherry-pick #45705
This commit is contained in:
Mingyu Chen (Rayner)
2024-12-23 17:57:38 +08:00
committed by GitHub
parent 6454ee6589
commit 901b93264c

View File

@ -34,11 +34,11 @@ public class SimpleJobScheduler implements JobScheduler {
CascadesContext context = (CascadesContext) scheduleContext;
SessionVariable sessionVariable = context.getConnectContext().getSessionVariable();
while (!pool.isEmpty()) {
long elapsedS = context.getStatementContext().getStopwatch().elapsed(TimeUnit.MILLISECONDS) / 1000;
if (sessionVariable.enableNereidsTimeout
&& context.getStatementContext().getStopwatch().elapsed(TimeUnit.MILLISECONDS)
> sessionVariable.nereidsTimeoutSecond * 1000L) {
throw new DoNotFallbackException(
"Nereids cost too much time ( > " + sessionVariable.nereidsTimeoutSecond + "s )");
&& elapsedS > sessionVariable.nereidsTimeoutSecond) {
throw new DoNotFallbackException(String.format("Nereids cost too much time ( %ds > %ds",
elapsedS, sessionVariable.nereidsTimeoutSecond));
}
Job job = pool.pop();
job.execute();