Skip to content

feat(execution): make the VariableRender tolerant about any runtime e…#15505

Merged
loicmathieu merged 2 commits intodevelopfrom
feat/variable-renderer-exception
Apr 14, 2026
Merged

feat(execution): make the VariableRender tolerant about any runtime e…#15505
loicmathieu merged 2 commits intodevelopfrom
feat/variable-renderer-exception

Conversation

@loicmathieu
Copy link
Copy Markdown
Member

…xception

Some PebbleFunction may throws RuntimeException, even if it would be cleaner to handle all possible exceptions in all functions, this is practically impossible. To harden the executor and the scheduler, we encapsulate any RuntimeException inside the checked IllegalVariableEvaluationException.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

🐋 Docker image

ghcr.io/kestra-io/kestra-pr:15505
docker run --pull=always --rm -it -p 8080:8080 --user=root -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp ghcr.io/kestra-io/kestra-pr:15505 server local

🧪 Java Unit Tests

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
Java Tests Report4853 ran4829 ✅22 ⚠️2 ❌49m 48s 196ms
TestResultTime ⏱
Java Tests Report
PostgresServiceLivenessCoordinatorTest.[1] workerGroupKey=workerGroupKey❌ failure32s 641ms
PostgresServiceLivenessCoordinatorTest.[2] workerGroupKey=❌ failure32s 412ms

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

Tests report quick summary:

failed ❌ > tests: 4855, success: 4829, skipped: 22, failed: 4

Project Status Success Skipped Failed
cli success ✅ 47 0 0
core success ✅ 2321 0 0
executor success ✅ 38 0 0
jdbc success ✅ 11 0 0
jdbc-h2 success ✅ 565 0 0
jdbc-mysql success ✅ 557 0 0
jdbc-postgres failed ❌ 556 0 2
processor success ✅ 7 0 0
queue success ✅ 31 0 0
runner-memory success ✅ 1 0 0
scheduler success ✅ 62 0 0
script success ✅ 35 0 0
storage-local success ✅ 64 0 0
webserver success ✅ 419 0 0
worker success ✅ 51 0 0
worker-controller success ✅ 86 0 0

Failed tests:

jdbc-postgres > io.kestra.runner.postgres.PostgresServiceLivenessCoordinatorTest > [1] workerGroupKey=workerGroupKey failed ❌ in 32.641
org.opentest4j.AssertionFailedError: 
Expecting value to be true but was false

org.opentest4j.AssertionFailedError: 
Expecting value to be true but was false
	at io.kestra.executor.AbstractServiceLivenessCoordinatorTest.shouldResubmitTaskWhenWorkerIsStopped(AbstractServiceLivenessCoordinatorTest.java:143)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at io.micronaut.test.extensions.junit5.MicronautJunit5Extension$3.proceed(MicronautJunit5Extension.java:175)
	at io.micronaut.test.extensions.AbstractMicronautExtension.interceptEach(AbstractMicronautExtension.java:171)
	at io.micronaut.test.extensions.AbstractMicronautExtension.interceptTest(AbstractMicronautExtension.java:128)
	at io.micronaut.test.extensions.junit5.MicronautJunit5Extension.interceptTestTemplateMethod(MicronautJunit5Extension.java:162)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.java:293)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1716)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.java:293)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1716)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1450)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2019)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)

jdbc-postgres > io.kestra.runner.postgres.PostgresServiceLivenessCoordinatorTest > [2] workerGroupKey= failed ❌ in 32.412
org.opentest4j.AssertionFailedError: 
Expecting value to be true but was false

org.opentest4j.AssertionFailedError: 
Expecting value to be true but was false
	at io.kestra.executor.AbstractServiceLivenessCoordinatorTest.shouldResubmitTaskWhenWorkerIsStopped(AbstractServiceLivenessCoordinatorTest.java:143)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at io.micronaut.test.extensions.junit5.MicronautJunit5Extension$3.proceed(MicronautJunit5Extension.java:175)
	at io.micronaut.test.extensions.AbstractMicronautExtension.interceptEach(AbstractMicronautExtension.java:171)
	at io.micronaut.test.extensions.AbstractMicronautExtension.interceptTest(AbstractMicronautExtension.java:128)
	at io.micronaut.test.extensions.junit5.MicronautJunit5Extension.interceptTestTemplateMethod(MicronautJunit5Extension.java:162)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.java:293)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1716)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.java:293)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1716)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1450)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2019)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)


Develocity build scan: https://develocity.kestra.io/s/qsvjnpc47ypue

@loicmathieu loicmathieu force-pushed the feat/variable-renderer-exception branch from 56af31a to 5024290 Compare April 13, 2026 08:39
@loicmathieu loicmathieu added the kind/breaking-change Code modifications needed before upgrading label Apr 13, 2026
@loicmathieu
Copy link
Copy Markdown
Member Author

Breaking Change

I also removed the alternative renderer hook which should only impact the only customer we know that uses it to have a backward compat with Handlebar.

Copy link
Copy Markdown
Member

@brian-mulier-p brian-mulier-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I don't see the runtime exception wrapping you're mentionning 🤔

@loicmathieu loicmathieu force-pushed the feat/variable-renderer-exception branch 2 times, most recently from e1c2a82 to b155000 Compare April 14, 2026 07:51
…xception

Some PebbleFunction may throws RuntimeException, even if it would be cleaner to handle all possible exceptions in all functions, this is practically impossible.
To harden the executor and the scheduler, we encapsulate any RuntimeException inside the checked IllegalVariableEvaluationException.
@loicmathieu loicmathieu force-pushed the feat/variable-renderer-exception branch from b155000 to 5a88c94 Compare April 14, 2026 10:07
@loicmathieu loicmathieu merged commit a80052e into develop Apr 14, 2026
9 of 12 checks passed
@loicmathieu loicmathieu deleted the feat/variable-renderer-exception branch April 14, 2026 11:48
@github-project-automation github-project-automation Bot moved this from To review to Done in Pull Requests Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/breaking-change Code modifications needed before upgrading

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants