[Bug 63832] Unable to stop because WebappClassLoaderBase.checkThreadLocalMapForLeaks can't load class(class from deployed aplication - probably undeployed)

2019-10-14 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63832

--- Comment #4 from Daniel Charczyński  ---
Thanks a lot.
Which commit solve this problem?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1868434 - in /tomcat/site/trunk/docs/tomcat-9.0-doc: ./ annotationapi/ annotationapi/javax/ annotationapi/javax/annotation/ annotationapi/javax/annotation/security/ annotationapi/javax/an

2019-10-14 Thread markt
Author: markt
Date: Mon Oct 14 09:23:32 2019
New Revision: 1868434

URL: http://svn.apache.org/viewvc?rev=1868434&view=rev
Log:
Update docs for 9.0.27 release


[This commit notification would consist of 70 parts, 
which exceeds the limit of 50 ones, so it was shortened to the summary.]

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



svn commit: r1868435 - in /tomcat/site/trunk: ./ docs/ xdocs/

2019-10-14 Thread markt
Author: markt
Date: Mon Oct 14 09:24:30 2019
New Revision: 1868435

URL: http://svn.apache.org/viewvc?rev=1868435&view=rev
Log:
Update site for 9.0.27 release

Modified:
tomcat/site/trunk/build.properties.default
tomcat/site/trunk/docs/doap_Tomcat.rdf
tomcat/site/trunk/docs/download-90.html
tomcat/site/trunk/docs/index.html
tomcat/site/trunk/docs/migration-9.html
tomcat/site/trunk/docs/oldnews.html
tomcat/site/trunk/docs/whichversion.html
tomcat/site/trunk/xdocs/doap_Tomcat.rdf
tomcat/site/trunk/xdocs/download-90.xml
tomcat/site/trunk/xdocs/index.xml
tomcat/site/trunk/xdocs/migration-9.xml
tomcat/site/trunk/xdocs/oldnews.xml
tomcat/site/trunk/xdocs/whichversion.xml

Modified: tomcat/site/trunk/build.properties.default
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/build.properties.default?rev=1868435&r1=1868434&r2=1868435&view=diff
==
--- tomcat/site/trunk/build.properties.default (original)
+++ tomcat/site/trunk/build.properties.default Mon Oct 14 09:24:30 2019
@@ -38,7 +38,7 @@ tomcat.loc=http://www.apache.org/dist/to
 # - Tomcat versions -
 tomcat70=7.0.96
 tomcat85=8.5.46
-tomcat90=9.0.26
+tomcat90=9.0.27
 
 # - Download destination -
 tomcat-site-docs.home=${base.path}/tomcat-site-docs/

Modified: tomcat/site/trunk/docs/doap_Tomcat.rdf
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/doap_Tomcat.rdf?rev=1868435&r1=1868434&r2=1868435&view=diff
==
--- tomcat/site/trunk/docs/doap_Tomcat.rdf (original)
+++ tomcat/site/trunk/docs/doap_Tomcat.rdf Mon Oct 14 09:24:30 2019
@@ -60,8 +60,8 @@
 
   
 Latest Stable 9.0.x Release
-2019-08-17
-9.0.26
+2019-10-11
+9.0.27
   
 
 

Modified: tomcat/site/trunk/docs/download-90.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/download-90.html?rev=1868435&r1=1868434&r2=1868435&view=diff
==
--- tomcat/site/trunk/docs/download-90.html (original)
+++ tomcat/site/trunk/docs/download-90.html Mon Oct 14 09:24:30 2019
@@ -219,7 +219,7 @@
 Quick Navigation
 
 
-[define v]9.0.26[end]
+[define v]9.0.27[end]
 https://www.apache.org/dist/tomcat/tomcat-9/KEYS";>KEYS |
 [v] |
 Browse |

Modified: tomcat/site/trunk/docs/index.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/index.html?rev=1868435&r1=1868434&r2=1868435&view=diff
==
--- tomcat/site/trunk/docs/index.html (original)
+++ tomcat/site/trunk/docs/index.html Mon Oct 14 09:24:30 2019
@@ -243,33 +243,32 @@ project logo are trademarks of the Apach
 
 
 
-
-2019-09-19 Tomcat 9.0.26 Released
+
+2019-10-11 Tomcat 9.0.27 Released
 
 
 
-The Apache Tomcat Project is proud to announce the release of version 9.0.26
-of Apache Tomcat. The notable changes compared to 9.0.24 include:
+The Apache Tomcat Project is proud to announce the release of version 9.0.27
+of Apache Tomcat. The notable changes compared to 9.0.26 include:
 
 
 
-Update to Commons Daemon 1.2.1 to pick up fixes for regressions in
-Commons Daemon 1.2.0, most notably a failure to start when using
-a 32-bit JVM on Windows.
+Update to Commons Daemon 1.2.2 to pick up the fix for a regression in
+Commons Daemon 1.2.0 and 1.2.1 that triggered a crash on startup when
+running on a Windows OS that had not been fully updated.
 
-Avoid an NPE when accessing an https port using http.
+Fix some edge cases with NIO2 and TLS that could cause a request to
+hang.
 
-Correct the invalid automatic module names for the embedded JARs.
-
-Fix a potential hang when using HTTP/2 with the asynchronous Servlet
-API.
+Fix a memory leak introduced by the HTTP/2 timeout refactoring in 9.0.23
+that could occur when HTTP/2 or WebSocket was used.
 
 
 
 
 
 Full details of these changes, and all the other changes, are available in the
-Tomcat 9
+Tomcat 9
 changelog.
 
 

Modified: tomcat/site/trunk/docs/migration-9.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/migration-9.html?rev=1868435&r1=1868434&r2=1868435&view=diff
==
--- tomcat/site/trunk/docs/migration-9.html (original)
+++ tomcat/site/trunk/docs/migration-9.html Mon Oct 14 09:24:30 2019
@@ -873,8 +873,9 @@ of Apache Tomcat.
 9.0.20
 9.0.21
 9.0.22
-9.0.24
-9.0.26
+9.0.24
+9.0.26
+9.0.27
 , new version:
 
 9.0.0-M1
@@ -913,7 +914,8 @@ of Apache Tomcat.
 9.0.21
 9.0.22
 9.0.24
-9.0.26
+9.0.26
+9.0.27
 trunk (unreleased)
 
 

Modified: tomcat/site/trunk/docs/oldnews.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/oldnews.html?rev=1868435&r1=186843

svn commit: r36325 - /release/tomcat/tomcat-9/v9.0.26/

2019-10-14 Thread markt
Author: markt
Date: Mon Oct 14 09:25:31 2019
New Revision: 36325

Log:
Drop 9.0.26 from mirrors

Removed:
release/tomcat/tomcat-9/v9.0.26/


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



[ANN] Apache Tomcat 9.0.27 available

2019-10-14 Thread Mark Thomas
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 9.0.27.

Apache Tomcat 9 is an open source software implementation of the Java
Servlet, JavaServer Pages, Java Unified Expression Language, Java
WebSocket and JASPIC technologies.

Apache Tomcat 9.0.27 is a bugfix and feature release. The notable
changes compared to 9.0.26 include:

- Update to Commons Daemon 1.2.2 to pick up the fix for a regression in
  Commons Daemon 1.2.0 and 1.2.1 that triggered a crash on startup when
  running on a Windows OS that had not been fully updated.

- Fix some edge cases with NIO2 and TLS that could has a request to
  hang.

- Fix a memory leak introduced by the HTTP/2 timeout refactoring in
  9.0.23 that could occur when HTTP/2 or WebSocket was used.

Please refer to the change log for the complete list of changes:
http://tomcat.apache.org/tomcat-9.0-doc/changelog.html


Downloads:
http://tomcat.apache.org/download-90.cgi

Migration guides from Apache Tomcat 7.x and 8.x:
http://tomcat.apache.org/migration.html

Enjoy!

- The Apache Tomcat team


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



[Bug 63815] Expansion of JAVA_OPTS in catalina.sh containing '*' stops startup on linux

2019-10-14 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63815

--- Comment #4 from mrog...@zaizi.com  ---
Thank you for the comments.

I'm actually using Tomcat within docker so would like to avoid touching any
tomcat code or configuration, whether catalina.sh or setenv.sh.   The pattern
I'm seeing used more and more is to specify a long list of -D options in the
docker-compose.yml file.

Answers to questions 
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor

Agreed I should probably be using CATALINA_OPTS however that seems to have
exactly the same issue with expansion of '*' as JAVA_OPTS

I think the quoting I have used is O.K. since with a quick hack to the tomcat
source files then it works.

What exact change are you asking for?
It's taken me some time to diagnose and work-around this problem.  If I can
share knowledge then that helps the community.

I've fixed this by replacing $JAVA_OPTS with "${JAVA_OPTS//$'\n'/ }" in
catalina.sh.  As pointed out below the same effect can be obtained by set -o
noglob .

Also I couldn't see any discussion about globing in the Tomcat documentation or
comments so perhaps a sentence could be added?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63815] Expansion of JAVA_OPTS in catalina.sh containing '*' stops startup on linux

2019-10-14 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63815

mrog...@zaizi.com  changed:

   What|Removed |Added

 Status|NEEDINFO|NEW

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Update to Tomcat 9.0.27

2019-10-14 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 4892eda  Update to Tomcat 9.0.27
4892eda is described below

commit 4892eda90d42666eed56ae94e1039b86b086627e
Author: remm 
AuthorDate: Mon Oct 14 12:25:09 2019 +0200

Update to Tomcat 9.0.27
---
 modules/owb/pom.xml  | 2 +-
 res/tomcat-maven/pom.xml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/owb/pom.xml b/modules/owb/pom.xml
index 88328d3..1db0fda 100644
--- a/modules/owb/pom.xml
+++ b/modules/owb/pom.xml
@@ -36,7 +36,7 @@
 1.0
 1.0
 1.0.1
-9.0.26
+9.0.27
 
 
 
diff --git a/res/tomcat-maven/pom.xml b/res/tomcat-maven/pom.xml
index e620779..7944091 100644
--- a/res/tomcat-maven/pom.xml
+++ b/res/tomcat-maven/pom.xml
@@ -29,7 +29,7 @@
 
 UTF-8
 org.apache.catalina.startup.Tomcat
-9.0.26
+9.0.27
 
 
 


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



svn commit: r1868438 - in /tomcat/site/trunk/docs/tomcat-8.5-doc: ./ annotationapi/ annotationapi/javax/ annotationapi/javax/annotation/ annotationapi/javax/annotation/security/ annotationapi/javax/an

2019-10-14 Thread markt
Author: markt
Date: Mon Oct 14 10:39:18 2019
New Revision: 1868438

URL: http://svn.apache.org/viewvc?rev=1868438&view=rev
Log:
Update docs for 8.5.47 release


[This commit notification would consist of 69 parts, 
which exceeds the limit of 50 ones, so it was shortened to the summary.]

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



svn commit: r1868439 - in /tomcat/site/trunk: ./ docs/ xdocs/

2019-10-14 Thread markt
Author: markt
Date: Mon Oct 14 10:39:52 2019
New Revision: 1868439

URL: http://svn.apache.org/viewvc?rev=1868439&view=rev
Log:
Update site for 8.5.47 release

Modified:
tomcat/site/trunk/build.properties.default
tomcat/site/trunk/docs/doap_Tomcat.rdf
tomcat/site/trunk/docs/download-80.html
tomcat/site/trunk/docs/index.html
tomcat/site/trunk/docs/migration-85.html
tomcat/site/trunk/docs/oldnews.html
tomcat/site/trunk/docs/whichversion.html
tomcat/site/trunk/xdocs/doap_Tomcat.rdf
tomcat/site/trunk/xdocs/download-80.xml
tomcat/site/trunk/xdocs/index.xml
tomcat/site/trunk/xdocs/migration-85.xml
tomcat/site/trunk/xdocs/oldnews.xml
tomcat/site/trunk/xdocs/whichversion.xml

Modified: tomcat/site/trunk/build.properties.default
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/build.properties.default?rev=1868439&r1=1868438&r2=1868439&view=diff
==
--- tomcat/site/trunk/build.properties.default (original)
+++ tomcat/site/trunk/build.properties.default Mon Oct 14 10:39:52 2019
@@ -37,7 +37,7 @@ tomcat.loc=http://www.apache.org/dist/to
 
 # - Tomcat versions -
 tomcat70=7.0.96
-tomcat85=8.5.46
+tomcat85=8.5.47
 tomcat90=9.0.27
 
 # - Download destination -

Modified: tomcat/site/trunk/docs/doap_Tomcat.rdf
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/doap_Tomcat.rdf?rev=1868439&r1=1868438&r2=1868439&view=diff
==
--- tomcat/site/trunk/docs/doap_Tomcat.rdf (original)
+++ tomcat/site/trunk/docs/doap_Tomcat.rdf Mon Oct 14 10:39:52 2019
@@ -67,8 +67,8 @@
 
   
 Latest Stable 8.5.x Release
-2019-08-21
-8.5.46
+2019-10-11
+8.5.47
   
 
 

Modified: tomcat/site/trunk/docs/download-80.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/download-80.html?rev=1868439&r1=1868438&r2=1868439&view=diff
==
--- tomcat/site/trunk/docs/download-80.html (original)
+++ tomcat/site/trunk/docs/download-80.html Mon Oct 14 10:39:52 2019
@@ -226,7 +226,7 @@
 Quick Navigation
 
 
-[define v]8.5.46[end]
+[define v]8.5.47[end]
 https://www.apache.org/dist/tomcat/tomcat-8/KEYS";>KEYS |
 [v] |
 Browse |

Modified: tomcat/site/trunk/docs/index.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/index.html?rev=1868439&r1=1868438&r2=1868439&view=diff
==
--- tomcat/site/trunk/docs/index.html (original)
+++ tomcat/site/trunk/docs/index.html Mon Oct 14 10:39:52 2019
@@ -281,33 +281,31 @@ changelog.
 
 
 
-2019-09-19 Tomcat 8.5.46 Released
+2019-10-11 Tomcat 8.5.46 Released
 
 
 
-The Apache Tomcat Project is proud to announce the release of version 8.5.46
+The Apache Tomcat Project is proud to announce the release of version 8.5.47
 of Apache Tomcat. Apache Tomcat 8.5.x replaces 8.0.x and includes new features
 pulled forward from Tomcat 9.0.x. The minimum Java version and implemented
 specification versions remain unchanged. The notable changes compared
-to 8.5.45 include:
+to 8.5.46 include:
 
 
 
-Update to Commons Daemon 1.2.1 to pick up fixes for regressions in
-Commons Daemon 1.2.0, most notably a failure to start when using
-a 32-bit JVM on Windows.
+Update to Commons Daemon 1.2.2 to pick up the fix for a regression in
+Commons Daemon 1.2.0 and 1.2.1 that triggered a crash on startup when
+running on a Windows OS that had not been fully updated.
 
-Avoid an NPE when accessing an https port using http.
-
-Fix a potential hang when using HTTP/2 with the asynchronous Servlet
-API.
+Fix some edge cases with NIO2 and TLS that could cause a request to
+hang.
 
 
 
 
 
 Full details of these changes, and all the other changes, are available in the
-Tomcat 8.5
+Tomcat 8.5
 changelog.
 
 

Modified: tomcat/site/trunk/docs/migration-85.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/migration-85.html?rev=1868439&r1=1868438&r2=1868439&view=diff
==
--- tomcat/site/trunk/docs/migration-85.html (original)
+++ tomcat/site/trunk/docs/migration-85.html Mon Oct 14 10:39:52 2019
@@ -729,8 +729,9 @@ of Apache Tomcat.
 8.5.41
 8.5.42
 8.5.43
-8.5.45
-8.5.46
+8.5.45
+8.5.46
+8.5.47
 , new version:
 
 8.5.0
@@ -768,7 +769,8 @@ of Apache Tomcat.
 8.5.42
 8.5.43
 8.5.45
-8.5.46
+8.5.46
+8.5.47
 trunk (unreleased)
 
 

Modified: tomcat/site/trunk/docs/oldnews.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/oldnews.html?rev=1868439&r1=1868438&r2=1868439&view=diff
==
--- tomcat/site/trunk/docs/oldnews.html (ori

svn commit: r1868440 - in /tomcat/site/trunk: docs/index.html xdocs/index.xml

2019-10-14 Thread markt
Author: markt
Date: Mon Oct 14 10:40:25 2019
New Revision: 1868440

URL: http://svn.apache.org/viewvc?rev=1868440&view=rev
Log:
Fix missed update

Modified:
tomcat/site/trunk/docs/index.html
tomcat/site/trunk/xdocs/index.xml

Modified: tomcat/site/trunk/docs/index.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/index.html?rev=1868440&r1=1868439&r2=1868440&view=diff
==
--- tomcat/site/trunk/docs/index.html (original)
+++ tomcat/site/trunk/docs/index.html Mon Oct 14 10:40:25 2019
@@ -280,8 +280,8 @@ changelog.
 
 
 
-
-2019-10-11 Tomcat 8.5.46 Released
+
+2019-10-11 Tomcat 8.5.47 Released
 
 
 

Modified: tomcat/site/trunk/xdocs/index.xml
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/index.xml?rev=1868440&r1=1868439&r2=1868440&view=diff
==
--- tomcat/site/trunk/xdocs/index.xml (original)
+++ tomcat/site/trunk/xdocs/index.xml Mon Oct 14 10:40:25 2019
@@ -65,7 +65,7 @@ changelog.
 
 
 
-
+
 
 The Apache Tomcat Project is proud to announce the release of version 8.5.47
 of Apache Tomcat. Apache Tomcat 8.5.x replaces 8.0.x and includes new features



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



svn commit: r1868441 - in /tomcat/site/trunk: docs/download-80.html xdocs/download-80.xml

2019-10-14 Thread markt
Author: markt
Date: Mon Oct 14 10:41:42 2019
New Revision: 1868441

URL: http://svn.apache.org/viewvc?rev=1868441&view=rev
Log:
Align browse link target with 9.0.x and 7.0.x

Modified:
tomcat/site/trunk/docs/download-80.html
tomcat/site/trunk/xdocs/download-80.xml

Modified: tomcat/site/trunk/docs/download-80.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/download-80.html?rev=1868441&r1=1868440&r2=1868441&view=diff
==
--- tomcat/site/trunk/docs/download-80.html (original)
+++ tomcat/site/trunk/docs/download-80.html Mon Oct 14 10:41:42 2019
@@ -229,7 +229,7 @@
 [define v]8.5.47[end]
 https://www.apache.org/dist/tomcat/tomcat-8/KEYS";>KEYS |
 [v] |
-Browse |
+Browse |
 https://archive.apache.org/dist/tomcat/tomcat-8";>Archives
   
 

Modified: tomcat/site/trunk/xdocs/download-80.xml
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/download-80.xml?rev=1868441&r1=1868440&r2=1868441&view=diff
==
--- tomcat/site/trunk/xdocs/download-80.xml (original)
+++ tomcat/site/trunk/xdocs/download-80.xml Mon Oct 14 10:41:42 2019
@@ -26,7 +26,7 @@
 [define v]8.5.47[end]
 https://www.apache.org/dist/tomcat/tomcat-8/KEYS";>KEYS |
 [v] |
-Browse |
+Browse |
 https://archive.apache.org/dist/tomcat/tomcat-8";>Archives
   
   



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



svn commit: r36328 - /release/tomcat/tomcat-8/v8.5.46/

2019-10-14 Thread markt
Author: markt
Date: Mon Oct 14 10:42:37 2019
New Revision: 36328

Log:
Drop 8.5.46 from mirrors

Removed:
release/tomcat/tomcat-8/v8.5.46/


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



[ANN] Apache Tomcat 8.5.47 available

2019-10-14 Thread Mark Thomas
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 8.5.47.

Apache Tomcat 8 is an open source software implementation of the Java
Servlet, JavaServer Pages, Java Unified Expression Language, Java
WebSocket and Java Authentication Service Provider Interface for
Containers technologies.

Apache Tomcat 8.5.x replaces 8.0.x and includes new features pulled
forward from the 9.0.x branch. The notable changes since 8.5.46 include:

- Update to Commons Daemon 1.2.2 to pick up the fix for a regression in
  Commons Daemon 1.2.0 and 1.2.1 that triggered a crash on startup when
  running on a Windows OS that had not been fully updated.

- Fix some edge cases with NIO2 and TLS that could has a request to
  hang.

Please refer to the change log for the complete list of changes:
http://tomcat.apache.org/tomcat-8.5-doc/changelog.html


Downloads:
http://tomcat.apache.org/download-80.cgi

Migration guides from Apache Tomcat 7.x and 8.0.x:
http://tomcat.apache.org/migration.html

Enjoy!

- The Apache Tomcat team


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



[tomcat] branch master updated (4892eda -> 327c553)

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 4892eda  Update to Tomcat 9.0.27
 new 44a50ce  Add test case for bug 63816
 new 85289c3  Add debug log messages for the triggering of async listener 
events
 new 327c553  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 
async errors

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/catalina/core/AsyncContextImpl.java |  12 ++
 .../apache/catalina/core/LocalStrings.properties   |   4 +
 java/org/apache/coyote/AbstractProcessor.java  |  13 +-
 java/org/apache/coyote/AsyncStateMachine.java  |  32 +
 .../apache/catalina/core/TestAsyncContextImpl.java | 149 +
 webapps/docs/changelog.xml |   6 +
 6 files changed, 178 insertions(+), 38 deletions(-)


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



[tomcat] 01/03: Add test case for bug 63816

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 44a50ce0c7cfe40ed0aa4c422570cc2d278eb569
Author: Mark Thomas 
AuthorDate: Wed Oct 9 11:49:19 2019 +0100

Add test case for bug 63816
---
 .../apache/catalina/core/TestAsyncContextImpl.java | 149 +
 1 file changed, 149 insertions(+)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index e02753d..35165b6 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -25,8 +25,10 @@ import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.servlet.AsyncContext;
 import javax.servlet.AsyncEvent;
@@ -56,6 +58,8 @@ import org.apache.catalina.Context;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
+import org.apache.catalina.connector.TestCoyoteAdapter;
+import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.catalina.valves.TesterAccessLogValve;
@@ -2861,4 +2865,149 @@ public class TestAsyncContextImpl extends 
TomcatBaseTest {
 
resp.getOutputStream().write("OK".getBytes(StandardCharsets.UTF_8));
 }
 }
+
+
+/*
+ * Tests an error on an async thread before the container thread that 
called
+ * startAsync() has returned to the container.
+ *
+ * Required sequence is:
+ * - enter Servlet's service() method
+ * - startAsync()
+ * - start async thread
+ * - close client connection
+ * - write on async thread -> I/O error
+ * - exit Servlet's service() method
+ *
+ * This test makes extensive use of instance fields in the Servlet that
+ * would normally be considered very poor practice. It is only safe in this
+ * test as the Servlet only processes a single request.
+ */
+@Test
+public void testBug63816() throws Exception {
+CountDownLatch doGetLatch = new CountDownLatch(1);
+CountDownLatch clientCloseLatch = new CountDownLatch(1);
+CountDownLatch threadCompleteLatch = new CountDownLatch(1);
+
+AtomicBoolean ise = new AtomicBoolean(true);
+
+// Setup Tomcat instance
+Tomcat tomcat = getTomcatInstance();
+
+// No file system docBase required
+Context ctx = tomcat.addContext("", null);
+
+Bug63816Servlet bug63816Servlet = new Bug63816Servlet(doGetLatch, 
clientCloseLatch, threadCompleteLatch, ise);
+Wrapper wrapper = Tomcat.addServlet(ctx, "bug63816Servlet", 
bug63816Servlet);
+wrapper.setAsyncSupported(true);
+ctx.addServletMappingDecoded("/*", "bug63816Servlet");
+
+tomcat.start();
+
+Bug63816Client client = new Bug63816Client();
+client.setPort(getPort());
+client.setRequest(new String[] { "GET / HTTP/1.1" + 
SimpleHttpClient.CRLF +
+ "Host: localhost:" + 
SimpleHttpClient.CRLF +
+ SimpleHttpClient.CRLF});
+client.connect();
+client.sendRequest();
+
+// Wait for async to start
+doGetLatch.await();
+
+client.disconnect();
+
+clientCloseLatch.countDown();
+
+threadCompleteLatch.await();
+
+Assert.assertFalse(ise.get());
+}
+
+
+private static final class Bug63816Client extends SimpleHttpClient {
+
+@Override
+public boolean isResponseBodyOK() {
+return true;
+}
+}
+
+
+private static final class Bug63816Servlet extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+private final CountDownLatch doGetLatch;
+private final CountDownLatch clientCloseLatch;
+private final CountDownLatch threadCompleteLatch;
+private final AtomicBoolean ise;
+
+public Bug63816Servlet(CountDownLatch doGetLatch, CountDownLatch 
clientCloseLatch,
+CountDownLatch threadCompleteLatch, AtomicBoolean ise) {
+this.doGetLatch = doGetLatch;
+this.clientCloseLatch = clientCloseLatch;
+this.threadCompleteLatch = threadCompleteLatch;
+this.ise = ise;
+}
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+throws ServletException, IOException {
+
+doGetLatch.countDown();
+
+AsyncContext ac = req.startAsync();
+Thread t = new 

[tomcat] 02/03: Add debug log messages for the triggering of async listener events

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 85289c3a7feeb10ee47662cb4f7649abee5b9230
Author: Mark Thomas 
AuthorDate: Mon Oct 14 16:14:52 2019 +0100

Add debug log messages for the triggering of async listener events
---
 java/org/apache/catalina/core/AsyncContextImpl.java   | 12 
 java/org/apache/catalina/core/LocalStrings.properties |  4 
 2 files changed, 16 insertions(+)

diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java 
b/java/org/apache/catalina/core/AsyncContextImpl.java
index 674236c..3f801d5 100644
--- a/java/org/apache/catalina/core/AsyncContextImpl.java
+++ b/java/org/apache/catalina/core/AsyncContextImpl.java
@@ -94,6 +94,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 
 @Override
 public void fireOnComplete() {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnComplete"));
+}
 List listenersCopy = new ArrayList<>();
 listenersCopy.addAll(listeners);
 
@@ -124,6 +127,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 Context context = this.context;
 
 if (result.get()) {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnTimeout"));
+}
 ClassLoader oldCL = context.bind(false, null);
 try {
 List listenersCopy = new ArrayList<>();
@@ -327,6 +333,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 List listenersCopy = new ArrayList<>();
 listenersCopy.addAll(listeners);
 listeners.clear();
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnStartAsync"));
+}
 for (AsyncListenerWrapper listener : listenersCopy) {
 try {
 listener.fireOnStartAsync(event);
@@ -401,6 +410,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 request.getCoyoteRequest().action(ActionCode.ASYNC_ERROR, null);
 
 if (fireOnError) {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnError"));
+}
 AsyncEvent errorEvent = new AsyncEvent(event.getAsyncContext(),
 event.getSuppliedRequest(), event.getSuppliedResponse(), 
t);
 List listenersCopy = new ArrayList<>();
diff --git a/java/org/apache/catalina/core/LocalStrings.properties 
b/java/org/apache/catalina/core/LocalStrings.properties
index 12bd425..fda5ec3 100644
--- a/java/org/apache/catalina/core/LocalStrings.properties
+++ b/java/org/apache/catalina/core/LocalStrings.properties
@@ -94,6 +94,10 @@ aprListener.wrongFIPSMode=Unexpected value of FIPSMode 
option of AprLifecycleLis
 asyncContextImpl.asyncDispachError=Error during asynchronous dispatch
 asyncContextImpl.asyncRunnableError=Error during processing of asynchronous 
Runnable via AsyncContext.start()
 asyncContextImpl.dispatchingStarted=Asynchronous dispatch operation has 
already been called. Additional asynchronous dispatch operation within the same 
asynchronous cycle is not allowed.
+asyncContextImpl.fireOnComplete=Firing onComplete() event for any 
AsyncListeners
+asyncContextImpl.fireOnError=Firing onError() event for any AsyncListeners
+asyncContextImpl.fireOnStartAsync=Firing onStartAsync() event for any 
AsyncListeners
+asyncContextImpl.fireOnTimeout=Firing onTimeout() event for any AsyncListeners
 asyncContextImpl.noAsyncDispatcher=The dispatcher returned from the 
ServletContext does not support asynchronous dispatching
 asyncContextImpl.onCompleteError=onComplete() call failed for listener of type 
[{0}]
 asyncContextImpl.onErrorError=onError() call failed for listener of type [{0}]


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



[tomcat] 03/03: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 async errors

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 327c5532f3f3123c937572541e56175851d73c48
Author: Mark Thomas 
AuthorDate: Mon Oct 14 16:18:17 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 async errors

Handle I/O errors on a non-container thread after asynchronous
processing has been started but before the container thread that started
asynchronous processing has completed processing the current
request/response.
---
 java/org/apache/coyote/AbstractProcessor.java | 13 +++
 java/org/apache/coyote/AsyncStateMachine.java | 32 ---
 webapps/docs/changelog.xml|  6 +
 3 files changed, 13 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index fc32745..d5c3ee1 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -110,17 +110,10 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 if (t != null) {
 request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
 }
-if (blockIo && !ContainerThreadMarker.isContainerThread() && 
isAsync()) {
-// The error occurred on a non-container thread during async
-// processing which means not all of the necessary clean-up will
-// have been completed. Dispatch to a container thread to do the
-// clean-up. Need to do it this way to ensure that all the 
necessary
-// clean-up is performed.
-asyncStateMachine.asyncMustError();
-if (getLog().isDebugEnabled()) {
-
getLog().debug(sm.getString("abstractProcessor.nonContainerThreadError"), t);
+if (blockIo && isAsync()) {
+if (asyncStateMachine.asyncError()) {
+processSocketEvent(SocketEvent.ERROR, true);
 }
-processSocketEvent(SocketEvent.ERROR, true);
 }
 }
 
diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index 5fe1ecc..00191ba 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -154,7 +154,6 @@ class AsyncStateMachine {
 DISPATCH_PENDING(true,  true,  false, false),
 DISPATCHING (true,  false, false, true),
 READ_WRITE_OP   (true,  true,  false, false),
-MUST_ERROR  (true,  true,  false, false),
 ERROR   (true,  true,  false, false);
 
 private final boolean isAsync;
@@ -434,36 +433,13 @@ class AsyncStateMachine {
 }
 
 
-synchronized void asyncMustError() {
-if (state == AsyncState.STARTED) {
-clearNonBlockingListeners();
-state = AsyncState.MUST_ERROR;
-} else {
-throw new IllegalStateException(
-sm.getString("asyncStateMachine.invalidAsyncState",
-"asyncMustError()", state));
-}
+synchronized boolean asyncError() {
+clearNonBlockingListeners();
+state = AsyncState.ERROR;
+return !ContainerThreadMarker.isContainerThread();
 }
 
 
-synchronized void asyncError() {
-if (state == AsyncState.STARTING ||
-state == AsyncState.STARTED ||
-state == AsyncState.DISPATCHED ||
-state == AsyncState.TIMING_OUT ||
-state == AsyncState.MUST_COMPLETE ||
-state == AsyncState.READ_WRITE_OP ||
-state == AsyncState.COMPLETING ||
-state == AsyncState.MUST_ERROR) {
-clearNonBlockingListeners();
-state = AsyncState.ERROR;
-} else {
-throw new IllegalStateException(
-sm.getString("asyncStateMachine.invalidAsyncState",
-"asyncError()", state));
-}
-}
-
 synchronized void asyncRun(Runnable runnable) {
 if (state == AsyncState.STARTING || state ==  AsyncState.STARTED ||
 state == AsyncState.READ_WRITE_OP) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a860c45..c36ce45 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -66,6 +66,12 @@
 AsyncListener.onTimeout() or
 AsyncListener.onError(). (markt)
   
+  
+63816: Correctly handle I/O errors on a non-container thread
+after asynchronous processing has been started but before the container
+thread that started asynchronous processing has completed processing 
the
+current request/response. (markt)
+  
 
   
 


-
To unsubscribe, e-mail: dev

[tomcat] branch 8.5.x updated (a7da104 -> bf24a92)

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from a7da104  63765: Properly mark container as FAILED when a JVM error 
occurs on stop # Conflicts: #   webapps/docs/changelog.xml
 new b57c622  Add test case for bug 63816
 new bf24a92  Add debug log messages for the triggering of async listener 
events

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/catalina/core/AsyncContextImpl.java |  12 ++
 .../apache/catalina/core/LocalStrings.properties   |   4 +
 .../apache/catalina/core/TestAsyncContextImpl.java | 149 +
 3 files changed, 165 insertions(+)


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



[tomcat] 02/02: Add debug log messages for the triggering of async listener events

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit bf24a9295f6b7dd5d11cc6bd5d610b2dd1b573ec
Author: Mark Thomas 
AuthorDate: Mon Oct 14 16:14:52 2019 +0100

Add debug log messages for the triggering of async listener events
---
 java/org/apache/catalina/core/AsyncContextImpl.java   | 12 
 java/org/apache/catalina/core/LocalStrings.properties |  4 
 2 files changed, 16 insertions(+)

diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java 
b/java/org/apache/catalina/core/AsyncContextImpl.java
index 674236c..3f801d5 100644
--- a/java/org/apache/catalina/core/AsyncContextImpl.java
+++ b/java/org/apache/catalina/core/AsyncContextImpl.java
@@ -94,6 +94,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 
 @Override
 public void fireOnComplete() {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnComplete"));
+}
 List listenersCopy = new ArrayList<>();
 listenersCopy.addAll(listeners);
 
@@ -124,6 +127,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 Context context = this.context;
 
 if (result.get()) {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnTimeout"));
+}
 ClassLoader oldCL = context.bind(false, null);
 try {
 List listenersCopy = new ArrayList<>();
@@ -327,6 +333,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 List listenersCopy = new ArrayList<>();
 listenersCopy.addAll(listeners);
 listeners.clear();
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnStartAsync"));
+}
 for (AsyncListenerWrapper listener : listenersCopy) {
 try {
 listener.fireOnStartAsync(event);
@@ -401,6 +410,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 request.getCoyoteRequest().action(ActionCode.ASYNC_ERROR, null);
 
 if (fireOnError) {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnError"));
+}
 AsyncEvent errorEvent = new AsyncEvent(event.getAsyncContext(),
 event.getSuppliedRequest(), event.getSuppliedResponse(), 
t);
 List listenersCopy = new ArrayList<>();
diff --git a/java/org/apache/catalina/core/LocalStrings.properties 
b/java/org/apache/catalina/core/LocalStrings.properties
index 9be2514..2b84fa8 100644
--- a/java/org/apache/catalina/core/LocalStrings.properties
+++ b/java/org/apache/catalina/core/LocalStrings.properties
@@ -95,6 +95,10 @@ aprListener.wrongFIPSMode=Unexpected value of FIPSMode 
option of AprLifecycleLis
 asyncContextImpl.asyncDispachError=Error during asynchronous dispatch
 asyncContextImpl.asyncRunnableError=Error during processing of asynchronous 
Runnable via AsyncContext.start()
 asyncContextImpl.dispatchingStarted=Asynchronous dispatch operation has 
already been called. Additional asynchronous dispatch operation within the same 
asynchronous cycle is not allowed.
+asyncContextImpl.fireOnComplete=Firing onComplete() event for any 
AsyncListeners
+asyncContextImpl.fireOnError=Firing onError() event for any AsyncListeners
+asyncContextImpl.fireOnStartAsync=Firing onStartAsync() event for any 
AsyncListeners
+asyncContextImpl.fireOnTimeout=Firing onTimeout() event for any AsyncListeners
 asyncContextImpl.noAsyncDispatcher=The dispatcher returned from the 
ServletContext does not support asynchronous dispatching
 asyncContextImpl.onCompleteError=onComplete() call failed for listener of type 
[{0}]
 asyncContextImpl.onErrorError=onError() call failed for listener of type [{0}]


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



[tomcat] 01/02: Add test case for bug 63816

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit b57c622ebe354796d92ede5f00e4fdff1921d519
Author: Mark Thomas 
AuthorDate: Wed Oct 9 11:49:19 2019 +0100

Add test case for bug 63816
---
 .../apache/catalina/core/TestAsyncContextImpl.java | 149 +
 1 file changed, 149 insertions(+)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 319556e..d7afe2d 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -25,8 +25,10 @@ import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.servlet.AsyncContext;
 import javax.servlet.AsyncEvent;
@@ -56,6 +58,8 @@ import org.apache.catalina.Context;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
+import org.apache.catalina.connector.TestCoyoteAdapter;
+import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.catalina.valves.TesterAccessLogValve;
@@ -2861,4 +2865,149 @@ public class TestAsyncContextImpl extends 
TomcatBaseTest {
 
resp.getOutputStream().write("OK".getBytes(StandardCharsets.UTF_8));
 }
 }
+
+
+/*
+ * Tests an error on an async thread before the container thread that 
called
+ * startAsync() has returned to the container.
+ *
+ * Required sequence is:
+ * - enter Servlet's service() method
+ * - startAsync()
+ * - start async thread
+ * - close client connection
+ * - write on async thread -> I/O error
+ * - exit Servlet's service() method
+ *
+ * This test makes extensive use of instance fields in the Servlet that
+ * would normally be considered very poor practice. It is only safe in this
+ * test as the Servlet only processes a single request.
+ */
+@Test
+public void testBug63816() throws Exception {
+CountDownLatch doGetLatch = new CountDownLatch(1);
+CountDownLatch clientCloseLatch = new CountDownLatch(1);
+CountDownLatch threadCompleteLatch = new CountDownLatch(1);
+
+AtomicBoolean ise = new AtomicBoolean(true);
+
+// Setup Tomcat instance
+Tomcat tomcat = getTomcatInstance();
+
+// No file system docBase required
+Context ctx = tomcat.addContext("", null);
+
+Bug63816Servlet bug63816Servlet = new Bug63816Servlet(doGetLatch, 
clientCloseLatch, threadCompleteLatch, ise);
+Wrapper wrapper = Tomcat.addServlet(ctx, "bug63816Servlet", 
bug63816Servlet);
+wrapper.setAsyncSupported(true);
+ctx.addServletMappingDecoded("/*", "bug63816Servlet");
+
+tomcat.start();
+
+Bug63816Client client = new Bug63816Client();
+client.setPort(getPort());
+client.setRequest(new String[] { "GET / HTTP/1.1" + 
SimpleHttpClient.CRLF +
+ "Host: localhost:" + 
SimpleHttpClient.CRLF +
+ SimpleHttpClient.CRLF});
+client.connect();
+client.sendRequest();
+
+// Wait for async to start
+doGetLatch.await();
+
+client.disconnect();
+
+clientCloseLatch.countDown();
+
+threadCompleteLatch.await();
+
+Assert.assertFalse(ise.get());
+}
+
+
+private static final class Bug63816Client extends SimpleHttpClient {
+
+@Override
+public boolean isResponseBodyOK() {
+return true;
+}
+}
+
+
+private static final class Bug63816Servlet extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+private final CountDownLatch doGetLatch;
+private final CountDownLatch clientCloseLatch;
+private final CountDownLatch threadCompleteLatch;
+private final AtomicBoolean ise;
+
+public Bug63816Servlet(CountDownLatch doGetLatch, CountDownLatch 
clientCloseLatch,
+CountDownLatch threadCompleteLatch, AtomicBoolean ise) {
+this.doGetLatch = doGetLatch;
+this.clientCloseLatch = clientCloseLatch;
+this.threadCompleteLatch = threadCompleteLatch;
+this.ise = ise;
+}
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+throws ServletException, IOException {
+
+doGetLatch.countDown();
+
+AsyncContext ac = req.startAsync();
+Thread t = new B

[tomcat] branch 8.5.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 async errors

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 0495f66  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 
async errors
0495f66 is described below

commit 0495f664541cf4394875bcc2dfb38b05343f68c4
Author: Mark Thomas 
AuthorDate: Mon Oct 14 16:18:17 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 async errors

Handle I/O errors on a non-container thread after asynchronous
processing has been started but before the container thread that started
asynchronous processing has completed processing the current
request/response.
---
 java/org/apache/coyote/AbstractProcessor.java | 13 +++
 java/org/apache/coyote/AsyncStateMachine.java | 32 ---
 webapps/docs/changelog.xml|  6 +
 3 files changed, 13 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index 357e052..55a350d 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -113,17 +113,10 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 if (t != null) {
 request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
 }
-if (blockIo && !ContainerThreadMarker.isContainerThread() && 
isAsync()) {
-// The error occurred on a non-container thread during async
-// processing which means not all of the necessary clean-up will
-// have been completed. Dispatch to a container thread to do the
-// clean-up. Need to do it this way to ensure that all the 
necessary
-// clean-up is performed.
-asyncStateMachine.asyncMustError();
-if (getLog().isDebugEnabled()) {
-
getLog().debug(sm.getString("abstractProcessor.nonContainerThreadError"), t);
+if (blockIo && isAsync()) {
+if (asyncStateMachine.asyncError()) {
+processSocketEvent(SocketEvent.ERROR, true);
 }
-processSocketEvent(SocketEvent.ERROR, true);
 }
 }
 
diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index cd98f38..81a883b 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -154,7 +154,6 @@ public class AsyncStateMachine {
 DISPATCH_PENDING(true,  true,  false, false),
 DISPATCHING (true,  false, false, true),
 READ_WRITE_OP   (true,  true,  false, false),
-MUST_ERROR  (true,  true,  false, false),
 ERROR   (true,  true,  false, false);
 
 private final boolean isAsync;
@@ -434,36 +433,13 @@ public class AsyncStateMachine {
 }
 
 
-public synchronized void asyncMustError() {
-if (state == AsyncState.STARTED) {
-clearNonBlockingListeners();
-state = AsyncState.MUST_ERROR;
-} else {
-throw new IllegalStateException(
-sm.getString("asyncStateMachine.invalidAsyncState",
-"asyncMustError()", state));
-}
+public synchronized boolean asyncError() {
+clearNonBlockingListeners();
+state = AsyncState.ERROR;
+return !ContainerThreadMarker.isContainerThread();
 }
 
 
-public synchronized void asyncError() {
-if (state == AsyncState.STARTING ||
-state == AsyncState.STARTED ||
-state == AsyncState.DISPATCHED ||
-state == AsyncState.TIMING_OUT ||
-state == AsyncState.MUST_COMPLETE ||
-state == AsyncState.READ_WRITE_OP ||
-state == AsyncState.COMPLETING ||
-state == AsyncState.MUST_ERROR) {
-clearNonBlockingListeners();
-state = AsyncState.ERROR;
-} else {
-throw new IllegalStateException(
-sm.getString("asyncStateMachine.invalidAsyncState",
-"asyncError()", state));
-}
-}
-
 public synchronized void asyncRun(Runnable runnable) {
 if (state == AsyncState.STARTING || state ==  AsyncState.STARTED ||
 state == AsyncState.READ_WRITE_OP) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ab69483..dbcaef7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -62,6 +62,12 @@
 AsyncListener.onTimeout() or
 AsyncListener.onError(). (markt)
   
+  
+63816: Correctly handle I/O errors on a non-container thread
+after asynchronous processing has been started but before the container
+thread t

[Bug 63815] Expansion of JAVA_OPTS in catalina.sh containing '*' stops startup on linux

2019-10-14 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63815

--- Comment #5 from Eugène Adell  ---
Your quoting is OK (confirmed in
https://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html
although the unix equivalent webpage doesn't mention this).

I'm not convinced Tomcat is guilty of anything here. Probably it fails starting
because the application is unable to run with an incomplete parameter, and
there are several workarounds for no-globbing. It's the normal behaviour of
shells to expand variables. Another workaround is reading a property file,
maybe that's what people are doing when facing this issue, I don't know.

--Also I couldn't see any discussion about globing in the Tomcat documentation
or comments so perhaps a sentence could be added?
Thanks, it's true :) The different variables are explained in the RUNNING.txt
file, we could add a note there but I'm scared very few people read that.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 7.0.x updated (2dbbd1e -> fe65d4c)

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 2dbbd1e  Tomcat 7.0.97 did not pass the vote
 new f5b70a4  Add test case for bug 63816
 new f7abce5  Add debug log messages for the triggering of async listener 
events
 new 09044a9  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 
async errors
 new fe65d4c  Remove sync that triggers deadlock with BZ 63816 test case

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/catalina/core/AsyncContextImpl.java |  12 ++
 .../apache/catalina/core/LocalStrings.properties   |   4 +
 java/org/apache/coyote/AbstractProcessor.java  |  13 +-
 java/org/apache/coyote/AsyncStateMachine.java  |  30 +
 java/org/apache/tomcat/util/net/JIoEndpoint.java   |  52 
 .../apache/catalina/core/TestAsyncContextImpl.java | 148 +
 webapps/docs/changelog.xml |   6 +
 7 files changed, 201 insertions(+), 64 deletions(-)


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



[tomcat] 01/04: Add test case for bug 63816

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit f5b70a44e9f32e1d1b67e72e7235da3f1e7e41ae
Author: Mark Thomas 
AuthorDate: Wed Oct 9 11:49:19 2019 +0100

Add test case for bug 63816
---
 .../apache/catalina/core/TestAsyncContextImpl.java | 148 +
 1 file changed, 148 insertions(+)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 461b1e1..2e9dbcf 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -24,8 +24,10 @@ import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.servlet.AsyncContext;
 import javax.servlet.AsyncEvent;
@@ -54,7 +56,9 @@ import org.apache.catalina.Loader;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
+import org.apache.catalina.connector.TestCoyoteAdapter;
 import org.apache.catalina.deploy.ErrorPage;
+import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.catalina.valves.TesterAccessLogValve;
@@ -2607,4 +2611,148 @@ public class TestAsyncContextImpl extends 
TomcatBaseTest {
 }
 
 }
+
+
+/*
+ * Tests an error on an async thread before the container thread that 
called
+ * startAsync() has returned to the container.
+ *
+ * Required sequence is:
+ * - enter Servlet's service() method
+ * - startAsync()
+ * - start async thread
+ * - close client connection
+ * - write on async thread -> I/O error
+ * - exit Servlet's service() method
+ *
+ * This test makes extensive use of instance fields in the Servlet that
+ * would normally be considered very poor practice. It is only safe in this
+ * test as the Servlet only processes a single request.
+ */
+@Test
+public void testBug63816() throws Exception {
+CountDownLatch doGetLatch = new CountDownLatch(1);
+CountDownLatch clientCloseLatch = new CountDownLatch(1);
+CountDownLatch threadCompleteLatch = new CountDownLatch(1);
+
+AtomicBoolean ise = new AtomicBoolean(true);
+
+// Setup Tomcat instance
+Tomcat tomcat = getTomcatInstance();
+
+// No file system docBase required
+Context ctx = tomcat.addContext("", null);
+
+Bug63816Servlet bug63816Servlet = new Bug63816Servlet(doGetLatch, 
clientCloseLatch, threadCompleteLatch, ise);
+Wrapper wrapper = Tomcat.addServlet(ctx, "bug63816Servlet", 
bug63816Servlet);
+wrapper.setAsyncSupported(true);
+ctx.addServletMapping("/*", "bug63816Servlet");
+
+tomcat.start();
+
+Bug63816Client client = new Bug63816Client();
+client.setPort(getPort());
+client.setRequest(new String[] { "GET / HTTP/1.1" + 
SimpleHttpClient.CRLF +
+ "Host: localhost:" + 
SimpleHttpClient.CRLF +
+ SimpleHttpClient.CRLF});
+client.connect();
+client.sendRequest();
+
+// Wait for async to start
+doGetLatch.await();
+
+client.disconnect();
+
+clientCloseLatch.countDown();
+
+threadCompleteLatch.await();
+
+Assert.assertFalse(ise.get());
+}
+
+
+private static final class Bug63816Client extends SimpleHttpClient {
+
+@Override
+public boolean isResponseBodyOK() {
+return true;
+}
+}
+
+
+private static final class Bug63816Servlet extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+private final CountDownLatch doGetLatch;
+private final CountDownLatch clientCloseLatch;
+private final CountDownLatch threadCompleteLatch;
+private final AtomicBoolean ise;
+
+public Bug63816Servlet(CountDownLatch doGetLatch, CountDownLatch 
clientCloseLatch,
+CountDownLatch threadCompleteLatch, AtomicBoolean ise) {
+this.doGetLatch = doGetLatch;
+this.clientCloseLatch = clientCloseLatch;
+this.threadCompleteLatch = threadCompleteLatch;
+this.ise = ise;
+}
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+throws ServletException, IOException {
+
+doGetLatch.countDown();
+
+AsyncContext ac = req.startAsync();
+Thread t = new Bug63816Thread(ac, clientCloseLatch, 
thread

[tomcat] 04/04: Remove sync that triggers deadlock with BZ 63816 test case

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit fe65d4c1aac1759e99befe417afde51dded567b5
Author: Mark Thomas 
AuthorDate: Mon Oct 14 17:51:56 2019 +0100

Remove sync that triggers deadlock with BZ 63816 test case

I haven't been able to re-create the test failure on Linux that
promoted the adding of this sync. It is sufficiently long ago
that other refactoring may have provided an alternative fix.
---
 java/org/apache/tomcat/util/net/JIoEndpoint.java | 52 
 1 file changed, 25 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/JIoEndpoint.java 
b/java/org/apache/tomcat/util/net/JIoEndpoint.java
index 166640a..024de03 100644
--- a/java/org/apache/tomcat/util/net/JIoEndpoint.java
+++ b/java/org/apache/tomcat/util/net/JIoEndpoint.java
@@ -559,33 +559,31 @@ public class JIoEndpoint extends AbstractEndpoint 
{
 public void processSocketAsync(SocketWrapper socket,
 SocketStatus status) {
 try {
-synchronized (socket) {
-if (waitingRequests.remove(socket)) {
-SocketProcessor proc = new SocketProcessor(socket,status);
-ClassLoader loader = 
Thread.currentThread().getContextClassLoader();
-try {
-//threads should not be created by the webapp 
classloader
-if (Constants.IS_SECURITY_ENABLED) {
-PrivilegedAction pa = new PrivilegedSetTccl(
-getClass().getClassLoader());
-AccessController.doPrivileged(pa);
-} else {
-Thread.currentThread().setContextClassLoader(
-getClass().getClassLoader());
-}
-// During shutdown, executor may be null - avoid NPE
-if (!running) {
-return;
-}
-getExecutor().execute(proc);
-//TODO gotta catch RejectedExecutionException and 
properly handle it
-} finally {
-if (Constants.IS_SECURITY_ENABLED) {
-PrivilegedAction pa = new 
PrivilegedSetTccl(loader);
-AccessController.doPrivileged(pa);
-} else {
-
Thread.currentThread().setContextClassLoader(loader);
-}
+if (waitingRequests.remove(socket)) {
+SocketProcessor proc = new SocketProcessor(socket,status);
+ClassLoader loader = 
Thread.currentThread().getContextClassLoader();
+try {
+//threads should not be created by the webapp classloader
+if (Constants.IS_SECURITY_ENABLED) {
+PrivilegedAction pa = new PrivilegedSetTccl(
+getClass().getClassLoader());
+AccessController.doPrivileged(pa);
+} else {
+Thread.currentThread().setContextClassLoader(
+getClass().getClassLoader());
+}
+// During shutdown, executor may be null - avoid NPE
+if (!running) {
+return;
+}
+getExecutor().execute(proc);
+//TODO gotta catch RejectedExecutionException and properly 
handle it
+} finally {
+if (Constants.IS_SECURITY_ENABLED) {
+PrivilegedAction pa = new 
PrivilegedSetTccl(loader);
+AccessController.doPrivileged(pa);
+} else {
+Thread.currentThread().setContextClassLoader(loader);
 }
 }
 }


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



[tomcat] 03/04: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 async errors

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 09044a981e182f28ca1c86a2f8cbf63f7e6e17e1
Author: Mark Thomas 
AuthorDate: Mon Oct 14 16:18:17 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 async errors

Handle I/O errors on a non-container thread after asynchronous
processing has been started but before the container thread that started
asynchronous processing has completed processing the current
request/response.
---
 java/org/apache/coyote/AbstractProcessor.java | 13 +++-
 java/org/apache/coyote/AsyncStateMachine.java | 30 +++
 webapps/docs/changelog.xml|  6 ++
 3 files changed, 12 insertions(+), 37 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index e74c385..fdd90a6 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -97,17 +97,10 @@ public abstract class AbstractProcessor implements 
ActionHook, Processor {
 if (t != null) {
 request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
 }
-if (blockIo && !ContainerThreadMarker.isContainerThread() && 
isAsync()) {
-// The error occurred on a non-container thread during async
-// processing which means not all of the necessary clean-up will
-// have been completed. Dispatch to a container thread to do the
-// clean-up. Need to do it this way to ensure that all the 
necessary
-// clean-up is performed.
-asyncStateMachine.asyncMustError();
-if (getLog().isDebugEnabled()) {
-
getLog().debug(sm.getString("abstractProcessor.nonContainerThreadError"), t);
+if (blockIo && isAsync()) {
+if (asyncStateMachine.asyncError()) {
+getEndpoint().processSocketAsync(socketWrapper, 
SocketStatus.ERROR);
 }
-getEndpoint().processSocketAsync(socketWrapper, 
SocketStatus.ERROR);
 }
 }
 
diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index 07f9b5c..178c1ad 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -145,7 +145,6 @@ public class AsyncStateMachine {
 MUST_DISPATCH   (true,  true,  false, true),
 DISPATCH_PENDING(true,  true,  false, false),
 DISPATCHING (true,  false, false, true),
-MUST_ERROR  (true,  true,  false, false),
 ERROR   (true,  true,  false, false);
 
 private final boolean isAsync;
@@ -378,35 +377,12 @@ public class AsyncStateMachine {
 }
 
 
-public synchronized void asyncMustError() {
-if (state == AsyncState.STARTED) {
-state = AsyncState.MUST_ERROR;
-} else {
-throw new IllegalStateException(
-sm.getString("asyncStateMachine.invalidAsyncState",
-"asyncMustError()", state));
-}
-}
-
-
 public synchronized boolean asyncError() {
-boolean doDispatch = false;
-if (state == AsyncState.STARTING ||
-state == AsyncState.STARTED ||
-state == AsyncState.DISPATCHED ||
-state == AsyncState.TIMING_OUT ||
-state == AsyncState.MUST_COMPLETE ||
-state == AsyncState.COMPLETING ||
-state == AsyncState.MUST_ERROR) {
-state = AsyncState.ERROR;
-} else {
-throw new IllegalStateException(
-sm.getString("asyncStateMachine.invalidAsyncState",
-"asyncError()", state));
-}
-return doDispatch;
+state = AsyncState.ERROR;
+return !ContainerThreadMarker.isContainerThread();
 }
 
+
 public synchronized void asyncRun(Runnable runnable) {
 if (state == AsyncState.STARTING || state ==  AsyncState.STARTED) {
 // Execute the runnable using a container thread from the
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b042f39..924b71a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -81,6 +81,12 @@
 AsyncListener.onTimeout() or
 AsyncListener.onError(). (markt)
   
+  
+63816: Correctly handle I/O errors on a non-container thread
+after asynchronous processing has been started but before the container
+thread that started asynchronous processing has completed processing 
the
+current request/response. (markt)
+  
 
   
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional command

[Bug 63816] java.lang.IllegalStateException: Calling [asyncMustError()] is not valid for a request with Async state [STARTING]

2019-10-14 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63816

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #4 from Mark Thomas  ---
Fixed in:
- master for 9.0.28 onwards
- 8.5.x for 8.5.48 onwards
- 7.0.x for 7.0.98 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 02/04: Add debug log messages for the triggering of async listener events

2019-10-14 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit f7abce5ba8bdf91c43c076aacb083de94a1512b9
Author: Mark Thomas 
AuthorDate: Mon Oct 14 16:14:52 2019 +0100

Add debug log messages for the triggering of async listener events
---
 java/org/apache/catalina/core/AsyncContextImpl.java   | 12 
 java/org/apache/catalina/core/LocalStrings.properties |  4 
 2 files changed, 16 insertions(+)

diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java 
b/java/org/apache/catalina/core/AsyncContextImpl.java
index c39b48e..f57f7d1 100644
--- a/java/org/apache/catalina/core/AsyncContextImpl.java
+++ b/java/org/apache/catalina/core/AsyncContextImpl.java
@@ -98,6 +98,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 
 @Override
 public void fireOnComplete() {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnComplete"));
+}
 List listenersCopy = new 
ArrayList();
 listenersCopy.addAll(listeners);
 
@@ -145,6 +148,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 request.getCoyoteRequest().action(ActionCode.ASYNC_TIMEOUT, result);
 
 if (result.get()) {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnTimeout"));
+}
 
 ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
 ClassLoader newCL = 
request.getContext().getLoader().getClassLoader();
@@ -365,6 +371,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 List listenersCopy = new 
ArrayList();
 listenersCopy.addAll(listeners);
 listeners.clear();
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnStartAsync"));
+}
 for (AsyncListenerWrapper listener : listenersCopy) {
 try {
 listener.fireOnStartAsync(event);
@@ -439,6 +448,9 @@ public class AsyncContextImpl implements AsyncContext, 
AsyncContextCallback {
 request.getCoyoteRequest().action(ActionCode.ASYNC_ERROR, null);
 
 if (fireOnError) {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("asyncContextImpl.fireOnError"));
+}
 AsyncEvent errorEvent = new AsyncEvent(event.getAsyncContext(),
 event.getSuppliedRequest(), event.getSuppliedResponse(), 
t);
 List listenersCopy = new 
ArrayList();
diff --git a/java/org/apache/catalina/core/LocalStrings.properties 
b/java/org/apache/catalina/core/LocalStrings.properties
index f74a948..8db3ce7 100644
--- a/java/org/apache/catalina/core/LocalStrings.properties
+++ b/java/org/apache/catalina/core/LocalStrings.properties
@@ -95,6 +95,10 @@ aprListener.wrongFIPSMode=Unexpected value of FIPSMode 
option of AprLifecycleLis
 asyncContextImpl.asyncDispachError=Error during asynchronous dispatch
 asyncContextImpl.asyncRunnableError=Error during processing of asynchronous 
Runnable via AsyncContext.start()
 asyncContextImpl.dispatchingStarted=Asynchronous dispatch operation has 
already been called. Additional asynchronous dispatch operation within the same 
asynchronous cycle is not allowed.
+asyncContextImpl.fireOnComplete=Firing onComplete() event for any 
AsyncListeners
+asyncContextImpl.fireOnError=Firing onError() event for any AsyncListeners
+asyncContextImpl.fireOnStartAsync=Firing onStartAsync() event for any 
AsyncListeners
+asyncContextImpl.fireOnTimeout=Firing onTimeout() event for any AsyncListeners
 asyncContextImpl.noAsyncDispatcher=The dispatcher returned from the 
ServletContext does not support asynchronous dispatching
 asyncContextImpl.onCompleteError=onComplete() call failed for listener of type 
[{0}]
 asyncContextImpl.onErrorError=onError() call failed for listener of type [{0}]


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



Re: [tomcat] 03/03: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 async errors

2019-10-14 Thread Mark Thomas
On 14/10/2019 16:20, ma...@apache.org wrote:
> This is an automated email from the ASF dual-hosted git repository.
> 
> markt pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
> 
> commit 327c5532f3f3123c937572541e56175851d73c48
> Author: Mark Thomas 
> AuthorDate: Mon Oct 14 16:18:17 2019 +0100
> 
> Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63816 async errors
> 
> Handle I/O errors on a non-container thread after asynchronous
> processing has been started but before the container thread that started
> asynchronous processing has completed processing the current
> request/response.

Just a heads up that, while all the test cases pass, I think this patch
may over-simplify some edge cases. I'm planning on working on BZ 63817
next and the fix for that issue may end up re-instating some of the code
removed by this fix.

I plan to update/replace the state diagram once the code changes are
complete.

Mark

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



buildbot failure in on tomcat-trunk

2019-10-14 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4670

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 327c5532f3f3123c937572541e56175851d73c48
Blamelist: Mark Thomas ,remm 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



buildbot failure in on tomcat-7-trunk

2019-10-14 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-7-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-7-trunk/builds/1489

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-7-commit' 
triggered this build
Build Source Stamp: [branch 7.0.x] fe65d4c1aac1759e99befe417afde51dded567b5
Blamelist: Mark Thomas ,Violeta Georgieva 
,remm 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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