Skip to content

Commit 4a22e96

Browse files
committed
fix(jsonata): catch StackOverflowError to prevent worker crash on Windows
On Windows, the JVM default thread stack is ~256KB vs ~512KB+ on Linux. A circular parent-chain bug in dashjoin/jsonata Frame.lookup() causes infinite recursion, triggering StackOverflowError. Reactor's throwIfFatal treats it as a JVM fatal, and ThreadUncaughtExceptionHandler shuts down the entire worker process. Catch StackOverflowError in evaluateExpression() and convert to RuntimeException so the task fails gracefully without crashing the worker.
1 parent c6a2b00 commit 4a22e96

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • plugin-transform-json/src/main/java/io/kestra/plugin/transform/jsonata

plugin-transform-json/src/main/java/io/kestra/plugin/transform/jsonata/Transform.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ protected JsonNode evaluateExpression(RunContext runContext, JsonNode jsonNode)
6969
return MAPPER.valueToTree(result);
7070
} catch (JException | IllegalVariableEvaluationException e) {
7171
throw new RuntimeException("Failed to evaluate expression", e);
72+
} catch (StackOverflowError e) {
73+
throw new RuntimeException("JSONata expression exceeded JVM stack depth — reduce expression complexity or lower maxDepth", e);
7274
}
7375
}
7476
}

0 commit comments

Comments
 (0)