mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Prevent infinitely waiting loop
This commit is contained in:
parent
438b212653
commit
45af2dfa93
1 changed files with 10 additions and 0 deletions
|
|
@ -467,7 +467,17 @@ public class InterpreterFactory {
|
|||
|
||||
// if interpreters are already there, wait until they're being removed
|
||||
synchronized (interpreterGroup) {
|
||||
long interpreterRemovalWaitStart = System.currentTimeMillis();
|
||||
// interpreter process supposed to be terminated by RemoteInterpreterProcess.dereference()
|
||||
// in ZEPPELIN_INTERPRETER_CONNECT_TIMEOUT msec. However, if termination of the process and
|
||||
// removal from interpreter group take too long, throw an error.
|
||||
long interpreterRemovalWaitTimeout =
|
||||
Math.max(10*1000, conf.getInt(ConfVars.ZEPPELIN_INTERPRETER_CONNECT_TIMEOUT) * 2);
|
||||
while (interpreterGroup.containsKey(noteId)) {
|
||||
if (System.currentTimeMillis() - interpreterRemovalWaitStart >
|
||||
interpreterRemovalWaitTimeout) {
|
||||
throw new InterpreterException("Can not create interpreter");
|
||||
}
|
||||
try {
|
||||
interpreterGroup.wait(1000);
|
||||
} catch (InterruptedException e) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue