{"record":{"id":"8d4473a1b63362eb","repo":"conductor-oss/conductor","slug":"script-execution-interrupted-s","errorCode":null,"errorMessage":"Script execution interrupted: %s","messagePattern":"Script execution interrupted: (.+?)","errorType":"exception","errorClass":"NonTransientException","httpStatus":500,"severity":"error","filePath":"core/src/main/java/com/netflix/conductor/core/events/ScriptEvaluator.java","lineNumber":341,"sourceCode":"                Future<Value> futureResult =\n                        executorService.submit(() -> finalScriptContext.getContext().eval(source));\n                Value value =\n                        futureResult.get(maxExecutionTimeSeconds.getSeconds(), TimeUnit.SECONDS);\n                return getObject(value);\n            } catch (TimeoutException e) {\n                if (scriptContext != null) {\n                    interrupt(scriptContext.getContext());\n                }\n                throw new NonTransientException(\n                        String.format(\n                                \"Script not evaluated within %d seconds, interrupted.\",\n                                maxExecutionTimeSeconds.getSeconds()));\n            } catch (ExecutionException ee) {\n                handlePolyglotException(ee);\n                return null;\n            } catch (InterruptedException ie) {\n                Thread.currentThread().interrupt();\n                throw new NonTransientException(\"Script execution interrupted: \" + ie.getMessage());\n            } finally {\n                if (scriptContext != null) {\n                    scriptContext.clearBindings();\n                    if (!contextPool.offer(scriptContext)) {\n                        scriptContext.getContext().close();\n                        LOGGER.warn(\n                                \"ScriptExecutionContext pool is full, context closed and not returned to pool.\");\n                    }\n                }\n            }\n        } else {\n            // No context pool - create new context for each execution\n            try (Context context = createNewContext()) {\n                final Value jsBindings = context.getBindings(\"js\");\n                jsBindings.putMember(\"$\", input);\n                if (console != null) {\n                    jsBindings.putMember(\"console\", console);\n                }","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/core/src/main/java/com/netflix/conductor/core/events/ScriptEvaluator.java#L323-L359","documentation":"Thrown on the context-pool path when the thread executing ScriptEvaluator.eval is itself interrupted (InterruptedException) while waiting for the Future. The code resets the thread's interrupt flag and wraps the cause message in a NonTransientException. This is an orchestration-level cancellation, not a script defect.","triggerScenarios":"The workflow or task is cancelled/terminated by the engine, the JVM is shutting down, or an upstream caller interrupts the worker thread while a script eval is in flight on the pooled context path.","commonSituations":"Operator calls terminate on a running workflow whose JS task is executing; graceful shutdown interrupts in-flight evaluator threads; a parent thread pool is shutdown now.","solutions":["Confirm whether the interruption was operator-initiated (terminate workflow, shutdown) — if so, this is expected, not a bug.","Check server logs for shutdown or task-cancel events around the same timestamp.","If interruptions recur under load, review executor sizing and thread-pool saturation of the script executorService.","Do not treat this as retryable: the same script will be interrupted again if the workflow is being torn down."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    Object result = ScriptEvaluator.eval(script, input);\n} catch (NonTransientException e) {\n    if (Thread.currentThread().isInterrupted()) {\n        // interruption-driven; do not retry, surface to caller\n    }\n    handleScriptFailure(e);\n}","preventionTips":["Do not auto-retry on interruption — resolve the cancellation source first.","Avoid shutting down executors while in-flight evals are running.","Log interruption events with the workflow/task id for correlation."],"tags":["conductor","graalvm","javascript","script-evaluation","interruption","non-transient"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}