You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "sainadh777 (via GitHub)" <gi...@apache.org> on 2026/08/19 03:56:21 UTC

[PR] Defer abandoned connection trace formatting [tomcat]

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: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PR] Defer abandoned connection trace formatting [tomcat]

Posted by "sainadh777 (via GitHub)" <gi...@apache.org>.
sainadh777 commented on PR #1048:
URL: https://github.com/apache/tomcat/pull/1048#issuecomment-5337331120

   Hi @markt-asf, when you have time, would you be willing to review this JDBC-pool change? I selected you because you are a leading recent contributor to these paths and were the requested reviewer on the closest merged JDBC-pool PR. Thank you.


-- 
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: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PR] Defer abandoned connection trace formatting [tomcat]

Posted by "rmaucher (via GitHub)" <gi...@apache.org>.
rmaucher commented on PR #1048:
URL: https://github.com/apache/tomcat/pull/1048#issuecomment-6493640560

   Merged, thanks.


-- 
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: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PR] Defer abandoned connection trace formatting [tomcat]

Posted by "rmaucher (via GitHub)" <gi...@apache.org>.
rmaucher closed pull request #1048: Defer abandoned connection trace formatting
URL: https://github.com/apache/tomcat/pull/1048


-- 
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: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org