[
https://issues.apache.org/jira/browse/TOMEE-4652?focusedWorklogId=1032728&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1032728
]
ASF GitHub Bot logged work on TOMEE-4652:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Jul/26 07:13
Start Date: 29/Jul/26 07:13
Worklog Time Spent: 10m
Work Description: jungm commented on PR #2849:
URL: https://github.com/apache/tomee/pull/2849#issuecomment-5114378491
Ran the full build locally with the exact CI command on JDK 17 (matching
`main-pull-request-build.yml`):
```
mvn help:system -U -ntp --batch-mode --show-version --fail-at-end clean
install -DfailIfNoTests=false -DskipTests -Pstyle,rat
```
**BUILD SUCCESS** — all 326 modules, exit 0, no checkstyle or RAT
violations. No code changes were needed, so there's nothing new to push; the
GitHub `build` check on `d218410fd7` is also green.
Two things worth flagging from doing this:
1. **Both CI workflows run `-DskipTests`** (155 "Tests are skipped" lines in
my run), so the green check is compile + checkstyle + RAT only — the regression
test added here has never actually executed in CI. I ran the affected suites
separately on JDK 17: `tomee-catalina` 8/8 and `tomee-embedded` 21/21,
including `UserTransactionLeakTest`.
2. My first attempt at this ran on JDK 25 and failed in
`arquillian-openejb-transaction-provider`, `openejb-provisionning`,
`openejb-mockito` and `openejb-multicast`. That was a toolchain mismatch, not a
regression — none of those modules reference the classes touched here, and
everything passes on the JDK 17 that CI uses. Mentioning it only so the failure
isn't mistaken for something real if anyone builds on a newer JDK.
The TCK precondition from your earlier review still stands: I have not run
the Jakarta Transactions TCK, and the `apache/tomee-tck` exclusions are
untouched.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
Issue Time Tracking
-------------------
Worklog Id: (was: 1032728)
Time Spent: 50m (was: 40m)
> UserTransaction state leaks across pooled Tomcat threads between requests
> -------------------------------------------------------------------------
>
> Key: TOMEE-4652
> URL: https://issues.apache.org/jira/browse/TOMEE-4652
> Project: TomEE
> Issue Type: Bug
> Components: TomEE Core Server
> Reporter: Markus Jung
> Assignee: Markus Jung
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> When a servlet or JSP request leaves a {{UserTransaction}} in a non-clean
> state, the next request served on the same pooled Tomcat exec thread inherits
> that state. The victim request then either misses an expected
> {{IllegalStateException}} or gets an exception it does not expect. This is a
> leaker/victim pair: the same test fails in one vehicle and passes in the
> other, and which tests fail depends on which request lands on which thread.
> The Transactions 2.0 TCK web vehicles show this directly. At the full
> baseline (no exclusions), 49 tests run, 40 pass, 9 fail. All three
> signature-test vehicles pass, so the fault sits in {{UserTransaction}}
> handling, not in transaction propagation itself. The first failures in test
> order sit in the rollback area, before any {{setTransactionTimeout}} call
> runs, which rules out a timeout-related cause for those failures.
> Run alone on a fresh server, each area behaves correctly on its own: the
> rollback area passes 10 of 10, {{settransactiontimeout}} passes 4 of 4, and
> {{setrollbackonly}} passes 7 of 8 (its one failure, the last request in that
> area, is a victim of its own earlier request, not a new bug). There is no gap
> around commit-after-timeout: {{settransactiontimeout001}} sleeps 30 seconds
> before calling {{commit()}}, and when it reaches that call in isolation,
> {{commit()}} throws as required.
> Because a failing request poisons whichever request follows it on the same
> thread, excluding only the ids that fail at baseline just moves the failure
> onto different tests (a 9-id exclusion list leaves 4 different tests
> failing). All three areas are excluded whole in the harness so the default
> run stays stable and green.
> h2. Steps to reproduce / TCK reference
> Run the Jakarta Transactions 2.0 TCK web vehicles (servlet and JSP) against
> TomEE 11 without exclusions. Affected test classes and methods, currently
> excluded in {{runner-standalone/exclusions/transactions.txt}} in the
> apache/tomee-tck harness repo:
> *
> {{com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClient.java}}
> — {{testUserRollback001}} through {{testUserRollback005}}, each {{_from_jsp}}
> and {{_from_servlet}}
> *
> {{com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClient.java}}
> — {{testUserSetRollbackOnly001}} through {{testUserSetRollbackOnly004}},
> each {{_from_jsp}} and {{_from_servlet}}
> *
> {{com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClient.java}}
> — {{testUserSetTransactionTimeout001}} and
> {{testUserSetTransactionTimeout002}}, each {{_from_jsp}} and {{_from_servlet}}
> To confirm the fix, remove these three areas from {{transactions.txt}} and
> rerun the full baseline; all 49 tests should pass regardless of
> thread-to-request assignment.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)