[PR] Defer abandoned connection trace formatting [tomcat]

sainadh777 (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <[email protected]>
sainadh777 opened a new pull request, #1048:
URL: https://github.com/apache/tomcat/pull/1048

   ## Summary
   
   Complete maintained `TODO.md` item 39.1 by retaining abandoned-connection stack frames and formatting them only when the trace is actually read.
   
   ## Rationale and impact
   
   When `logAbandoned` is enabled, each connection borrow currently captures and immediately formats an exception stack trace into a `String`. Most of those traces are replaced by a later borrow without ever being reported.
   
   This change stores the captured `StackTraceElement[]` in `PooledConnection` and performs the existing string formatting lazily in `getStackTrace()`. The public String-based accessor methods remain compatible, and the text returned for a reported abandoned connection is unchanged. The regression test verifies both deferred formatting and the eventual trace contents.
   
   ## Validation
   
   All commands used JDK 25.
   
   - `ant -f modules/jdbc-pool/build.xml onetest -Dtest=AbandonedTraceTest -Dtomcat.xsl.loc=file:/private/tmp/tomcat-weekly.cfR2QA/webapps/docs/tomcat-docs.xsl -Dtomcat.project.loc=file:/private/tmp/tomcat-weekly.cfR2QA/modules/jdbc-pool/doc/project.xml` — passed: 1 test, 0 failures, 0 errors, 0 skipped.
   - `ant -f modules/jdbc-pool/build.xml test -Dtomcat.xsl.loc=file:/private/tmp/tomcat-weekly.cfR2QA/webapps/docs/tomcat-docs.xsl -Dtomcat.project.loc=file:/private/tmp/tomcat-weekly.cfR2QA/modules/jdbc-pool/doc/project.xml` — passed: all JDBC-pool functional, fairness, performance, and validation suites; 0 failures and 0 errors.
   - `ant validate -Dexecute.validate=true` — passed Checkstyle over 7,690 files.
   - `ant clean deploy` — passed clean source/distribution build.
   - `ant clean test` in an isolated Ubuntu 24.04 arm64 container (`eclipse-temurin:25-jdk-noble`, Ant 1.10.14, host networking) — passed the complete unfiltered suite in 31m38s: 41,264 tests, 0 failures, 0 errors, 315 skipped across 650 reports.
   - `output/build/bin/startup.sh`; `curl http://127.0.0.1:8080/`; `output/build/bin/shutdown.sh` in the same Linux container — HTTP 200 received and the generated Tomcat process stopped cleanly.
   
   For completeness, an initial unfiltered `ant test` on macOS was not used as the release gate because it hit platform-specific multicast routing failures, LibreSSL cipher mismatches, and pathological timing. The identical source snapshot subsequently passed the complete Linux run above.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.