Skip to content

Addded try catch block for Pre, Post processors.#6735

Open
rajat315315 wants to merge 1 commit into
apache:masterfrom
rajat315315:fix/processor-exception-handling
Open

Addded try catch block for Pre, Post processors.#6735
rajat315315 wants to merge 1 commit into
apache:masterfrom
rajat315315:fix/processor-exception-handling

Conversation

@rajat315315

@rajat315315 rajat315315 commented Jul 23, 2026

Copy link
Copy Markdown

Fixes: #6734

Description

  • Updated runPostProcessors(...) in org.apache.jmeter.threads.JMeterThread:
    • Wrapped ex.process() calls in try-catch (Exception | JMeterError e) blocks.
    • Logged errors with the element's name while preserving loop continuity.
  • Updated runPreProcessors(...) in org.apache.jmeter.threads.JMeterThread:
    • Wrapped ex.process() calls in try-catch (Exception | JMeterError e) blocks to ensure pre-processor failures do not interrupt subsequent pre-processors or sample sampling.
  • Added comprehensive unit tests in org.apache.jmeter.threads.TestJMeterThread:
    • testPostProcessorExceptionHandling(): Verifies that when a PostProcessor throws an exception, remaining PostProcessors and sample pipeline steps continue executing.
    • testPreProcessorExceptionHandling(): Verifies that when a PreProcessor throws an exception, remaining PreProcessors and the main sampler execute cleanly.

Motivation and Context

Resolves an issue where an uncaught RuntimeException in a PreProcessor or PostProcessor would abort the execution loop, preventing subsequent processors from running and skipping sample assertions, listener notifications, and compiler state cleanup.

How Has This Been Tested?

Ran Gradle test suite for core module:

./gradlew :src:core:test --tests "org.apache.jmeter.threads.TestJMeterThread"

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unhandled RuntimeException in PreProcessor or PostProcessor aborts remaining processors, assertions, and cleanup

1 participant