Test Failure: testJTATransactionUsedSeriallyWithOverlapAndCommitWithinLastStage NullPointerException #18813
Labels
release bug
This bug is present in a released version of Open Liberty
release:210011
team:Zombie Apocalypse
Milestone
Describe the bug
An application uses a ManagedExecutor to attempt to propagate Transaction context of an active UserTransaction to an asynchronous completion stage that overlaps the UserTransaction. Normally, the completion stage would raise IllegalStateException to reject the condition where it exists on 2 threads at the same time. However, if the application code suspends or resolves the UserTransaction while the asynchronous completion stage is attempting to start, the transaction code that ought to raise the IllegalStateException can hit a timing window where NullPointerException occurs.
Here is the code from the automated test case where we saw the failure occur intermittently,
If there is a stack trace, please include the FULL stack trace (without any
[internal classes]
lines in it). To find the full stack trace, you may need to check in$WLP_OUTPUT_DIR/messages.log
Steps to Reproduce
Run the scenario within the following automated test case until it eventually hits the timing window and fails,
Expected behavior
CompletableFuture.get
must raiseExecutionException
with chainedIllegalStateException
indicating that the transaction cannot be propagated to the asynchronous completion stage thread while the same transaction remains active on the main servlet thread.Diagnostic information:
or
Additional context
Because the error occurs while reporting an application bug, applications are recommended to fix the application bug by ensuring that the UserTransaction has been suspended from the servlet thread before permitting the start of any dependent completion stages to which the same Transaction context is propagated.
The text was updated successfully, but these errors were encountered: