[BUG] Unhandled RuntimeException in PreProcessor or PostProcessor aborts remaining processors, assertions, and cleanup
Expected behavior
Description
Currently in JMeterThread.java, execution loops for PreProcessors (runPreProcessors) and PostProcessors (runPostProcessors) do not wrap individual element processing in try-catch blocks.
If any PreProcessor or PostProcessor throws an unhandled RuntimeException (e.g. NullPointerException, IndexOutOfBoundsException, or malformed extraction error):
- Processor Execution Aborts: The
forloop inrunPreProcessors/runPostProcessorsimmediately terminates, skipping all subsequent processors attached to the same sampler. - Sampling Pipeline Bypass: Uncaught exceptions in post-processors bypass downstream steps in
executeSamplePackageincludingcheckAssertions(), listener notifications (notifyListeners), and compiler resource cleanup (compiler.done(pack)).
By contrast, assertion processing in JMeterThread.processAssertion() explicitly wraps each assertion in try-catch (Exception | JMeterError e) to log errors and allow remaining pipeline elements to execute.
Expected Behavior
When a PreProcessor or PostProcessor throws a runtime exception:
- The error should be logged with the element's name and stack trace.
- The thread should continue executing remaining
PreProcessors orPostProcessors. - Sample assertions, listener notifications, and compiler cleanup should execute normally.
Actual behavior
An exception in a single processor breaks out of the loop, skipping all remaining processors, assertions, and test element cleanup.
Steps to reproduce the problem
In src/core/src/main/java/org/apache/jmeter/threads/JMeterThread.java:
private static void runPostProcessors(List<? extends PostProcessor> extractors) {
for (PostProcessor ex : extractors) {
TestBeanHelper.prepare((TestElement) ex);
ex.process(); // Uncaught RuntimeException breaks loop and caller pipeline
}
}
### JMeter Version
6.0.0-SNAPSHOT
### Java Version
JDK 17 / JDK 21
### OS Version
_No response_Source: apache/jmeter