[SECURITY] CVE-2020-11996 Apache Tomcat HTTP/2 Denial of Service

2020-06-25 Thread Mark Thomas
CVE-2020-11996 Apache Tomcat HTTP/2 Denial of Service

Severity: Important

Vendor: The Apache Software Foundation

Versions Affected:
Apache Tomcat 10.0.0-M1 to 10.0.0-M5
Apache Tomcat 9.0.0.M1 to 9.0.35
Apache Tomcat 8.5.0 to 8.5.55

Description:
A specially crafted sequence of HTTP/2 requests could trigger high CPU
usage for several seconds. If a sufficient number of such requests were
made on concurrent HTTP/2 connections, the server could become unresponsive.

Mitigation:
- Upgrade to Apache Tomcat 10.0.0-M6 or later
- Upgrade to Apache Tomcat 9.0.36 or later
- Upgrade to Apache Tomcat 8.5.56 or later

Credit:
This issue was reported publicly via the Apache Tomcat Users mailing
list without reference to the potential for DoS. The DoS risks were
identified by the Apache Tomcat Security Team.

References:
[1] http://tomcat.apache.org/security-10.html
[2] http://tomcat.apache.org/security-9.html
[3] http://tomcat.apache.org/security-8.html

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



svn commit: r1879208 - in /tomcat/site/trunk: docs/security-10.html docs/security-8.html docs/security-9.html xdocs/security-10.xml xdocs/security-8.xml xdocs/security-9.xml

2020-06-25 Thread markt
Author: markt
Date: Thu Jun 25 21:55:42 2020
New Revision: 1879208

URL: http://svn.apache.org/viewvc?rev=1879208=rev
Log:
Add details for CVE-2020-11996

Modified:
tomcat/site/trunk/docs/security-10.html
tomcat/site/trunk/docs/security-8.html
tomcat/site/trunk/docs/security-9.html
tomcat/site/trunk/xdocs/security-10.xml
tomcat/site/trunk/xdocs/security-8.xml
tomcat/site/trunk/xdocs/security-9.xml

Modified: tomcat/site/trunk/docs/security-10.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/security-10.html?rev=1879208=1879207=1879208=diff
==
--- tomcat/site/trunk/docs/security-10.html (original)
+++ tomcat/site/trunk/docs/security-10.html Thu Jun 25 21:55:42 2020
@@ -2,7 +2,7 @@
 Apache Tomcat - Apache Tomcat 10 
vulnerabilitieshttp://tomcat.apache.org/;>Apache 
Tomcathttps://www.apache.org/foundation/contributing.html; target="_blank" 
class="pull-left">https://www.apache.org/images/SupportApache-small.png; class="support-asf" 
alt="Support Apache">http://www.apache.org/; target="_blank" class="pull-left">https://www.google.com/search; method="get">GOhttps://www.apache.org/events/current-event.html;>https://www.apache.org/events/current-event-234x60.png; alt="Next ASF 
event">
   Save the date!
 Apache TomcatHomeTaglibsMaven 
PluginDownloadWhich version?https://tomcat.apache.org/download-10.cgi;>Tomcat 10 
(alpha)https://tomcat.apache.org/download-90.cgi;>Tomcat 
9https://tomcat.apache.org/download-80.cgi;>Tomcat 
8https://tomcat.apache.org/download-70.cgi;>Tomcat 
7https://tomcat.apache.org/download-connectors.cgi;>Tomcat 
Connectorshttps://tomcat.apache.org/download-native.cgi;>Tomcat 
Nativehttps://tomcat.apache.org/download-taglibs.cgi;>Taglibshttps://archive.apache.org/dist/tomcat/;>ArchivesDocumentationTomcat 10.0 (alpha)Tomcat 
 >9.0Tomcat 
 >8.5Tomcat 
 >7.0Tomcat Connectorshref="./native-doc/">Tomcat Nativehref="https://cwiki.apache.org/confluence/display/TOMCAT;>Wikihref="./migration.html">Migration Guidehref="./presentations.html">PresentationsProblems? href="./security.html">Security Reportshref="./findhelp.html">Find helphref="https://cwiki.apache.org/confluence/display/TOMCAT/FAQ;>FAQ href="./lists.html">Mailing ListsBug 
 >DatabaseIRCGet 
 >InvolvedOverviewhref="./source.html">Source c
 odeBuildbothttps://cwiki.apache.org/confluence/x/vIPzBQ;>TranslationsToolsMediahttps://twitter.com/theapachetomcat;>Twitterhttps://www.youtube.com/c/ApacheTomcatOfficial;>YouTubehttps://blogs.apache.org/tomcat/;>BlogMiscWho We Arehttps://www.redbubble.com/people/comdev/works/30885254-apache-tomcat;>SwagHeritagehttp://www.apache.org;>Apache HomeResourcesContactLegalhttps://www.apache.org/foundation/contributing.html;>Support 
Apachehttps://www.apache.org/foundation/sponsorship.html;>Sponsorship<
 /li>http://www.apache.org/foundation/thanks.html;>Thankshttp://www.apache.org/licenses/;>LicenseContentTable of Contents
-Apache Tomcat 10.x 
vulnerabilitiesFixed 
in Apache Tomcat 10.0.0-M5
+Apache Tomcat 10.x 
vulnerabilitiesFixed 
in Apache Tomcat 10.0.0-M6Fixed in Apache Tomcat 
10.0.0-M5
 Apache Tomcat 10.x 
vulnerabilities
 This page lists all security vulnerabilities fixed in released versions
of Apache Tomcat 10.x. Each vulnerability is given a
@@ -39,9 +39,29 @@
Tomcat Security Team. Thank you.
 
 
+  7 
June 2020 Fixed in Apache Tomcat 10.0.0-M6
+
+Important: HTTP/2 DoS
+   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11996; 
rel="nofollow">CVE-2020-11996
+
+A specially crafted sequence of HTTP/2 requests could trigger high CPU
+   usage for several seconds. If a sufficient number of such requests were
+   made on concurrent HTTP/2 connections, the server could become
+   unresponsive.
+
+This was fixed with commit
+   https://github.com/apache/tomcat/commit/9434a44d3449d620b1be70206819f8275b4a7509;>9434a44d.
+
+This issue was reported publicly via the Apache Tomcat Users mailing 
list
+   on 21 May 2020 without reference to the potential for DoS. The DoS risks
+   were identified by the Apache Tomcat Security Team the same day. The
+   issue was made  public on 25 June 2020.
+
+Affects: 10.0.0-M1 to 10.0.0-M5
+
   11 
May 2020 Fixed in Apache Tomcat 10.0.0-M5
 
-High: Remote Code Execution via session persistence
+Important: Remote Code Execution via session 
persistence
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9484; 
rel="nofollow">CVE-2020-9484
 
 If:
@@ -74,7 +94,7 @@
 This was fixed with commit
https://github.com/apache/tomcat/commit/bb33048e3f9b4f2b70e4da2e6c4e34ca89023b1b;>bb33048e.
 
-This issue was reported to the Apache Tomcat Security Team by by jarvis
+This issue was reported to the Apache Tomcat Security Team by jarvis
threedr3am of pdd security research on 12 April 2020. The issue was 
made 
public on 

buildbot success in on tomcat-trunk

2020-06-25 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/5273

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] 3f205cc9d33c286ecf7a408685b41eeca3f6a58f
Blamelist: Mark Thomas 

Build succeeded!

Sincerely,
 -The Buildbot




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



[tomcat] branch 9.0.x updated: Fix various potential timing issues with this test.

2020-06-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 842df87  Fix various potential timing issues with this test.
842df87 is described below

commit 842df87563a64363441665ddde3727c2bc5ec4c1
Author: Mark Thomas 
AuthorDate: Thu Jun 25 19:28:02 2020 +0100

Fix various potential timing issues with this test.

On the client side messages were sent via the async API in a loop. That
creates a risk of breakage as it is not permitted to send the next
message until the previous message completes and the client wasn't
checking that the previous message had completed. SWitching to the basic
API avoids this.

On the server side, resume() was being called inside an async callback.
It was possible for resume() to be called and one or more messages to be
processed before the call to messages.clear(). Switching to the basic
API allows the order to be controlled correctly.
---
 .../apache/tomcat/websocket/TestWsSessionSuspendResume.java  | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java 
b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
index 8af8679..41d8d72 100644
--- a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
+++ b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
@@ -69,7 +69,7 @@ public class TestWsSessionSuspendResume extends 
WebSocketBaseTest {
 latch.countDown();
 });
 for (int i = 0; i < 8; i++) {
-wsSession.getAsyncRemote().sendText("echo");
+wsSession.getBasicRemote().sendText("echo");
 }
 
 boolean latchResult = latch.await(30, TimeUnit.SECONDS);
@@ -131,11 +131,13 @@ public class TestWsSessionSuspendResume extends 
WebSocketBaseTest {
 void addMessage(String message) {
 if (messages.size() == count) {
 ((WsSession) session).suspend();
-session.getAsyncRemote().sendText(messages.toString(), result 
-> {
+try {
+session.getBasicRemote().sendText(messages.toString());
+messages.clear();
 ((WsSession) session).resume();
-Assert.assertTrue(result.isOK());
-});
-messages.clear();
+} catch (IOException e) {
+Assert.fail();
+}
 } else {
 messages.add(message);
 }


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



[tomcat] branch master updated: Fix various potential timing issues with this test.

2020-06-25 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


The following commit(s) were added to refs/heads/master by this push:
 new 3f205cc  Fix various potential timing issues with this test.
3f205cc is described below

commit 3f205cc9d33c286ecf7a408685b41eeca3f6a58f
Author: Mark Thomas 
AuthorDate: Thu Jun 25 19:28:02 2020 +0100

Fix various potential timing issues with this test.

On the client side messages were sent via the async API in a loop. That
creates a risk of breakage as it is not permitted to send the next
message until the previous message completes and the client wasn't
checking that the previous message had completed. SWitching to the basic
API avoids this.

On the server side, resume() was being called inside an async callback.
It was possible for resume() to be called and one or more messages to be
processed before the call to messages.clear(). Switching to the basic
API allows the order to be controlled correctly.
---
 .../apache/tomcat/websocket/TestWsSessionSuspendResume.java  | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java 
b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
index cd2483e..b17dddf 100644
--- a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
+++ b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
@@ -69,7 +69,7 @@ public class TestWsSessionSuspendResume extends 
WebSocketBaseTest {
 latch.countDown();
 });
 for (int i = 0; i < 8; i++) {
-wsSession.getAsyncRemote().sendText("echo");
+wsSession.getBasicRemote().sendText("echo");
 }
 
 boolean latchResult = latch.await(30, TimeUnit.SECONDS);
@@ -131,11 +131,13 @@ public class TestWsSessionSuspendResume extends 
WebSocketBaseTest {
 void addMessage(String message) {
 if (messages.size() == count) {
 ((WsSession) session).suspend();
-session.getAsyncRemote().sendText(messages.toString(), result 
-> {
+try {
+session.getBasicRemote().sendText(messages.toString());
+messages.clear();
 ((WsSession) session).resume();
-Assert.assertTrue(result.isOK());
-});
-messages.clear();
+} catch (IOException e) {
+Assert.fail();
+}
 } else {
 messages.add(message);
 }


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



[tomcat] branch 8.5.x updated: Fix various potential timing issues with this test.

2020-06-25 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 2a13558  Fix various potential timing issues with this test.
2a13558 is described below

commit 2a135586b96fef8d1ea14a3c0045e7f90a399c48
Author: Mark Thomas 
AuthorDate: Thu Jun 25 19:28:02 2020 +0100

Fix various potential timing issues with this test.

On the client side messages were sent via the async API in a loop. That
creates a risk of breakage as it is not permitted to send the next
message until the previous message completes and the client wasn't
checking that the previous message had completed. SWitching to the basic
API avoids this.

On the server side, resume() was being called inside an async callback.
It was possible for resume() to be called and one or more messages to be
processed before the call to messages.clear(). Switching to the basic
API allows the order to be controlled correctly.
---
 .../tomcat/websocket/TestWsSessionSuspendResume.java | 20 
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java 
b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
index f6ea3b9..8901512 100644
--- a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
+++ b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
@@ -29,8 +29,6 @@ import javax.websocket.ContainerProvider;
 import javax.websocket.Endpoint;
 import javax.websocket.EndpointConfig;
 import javax.websocket.MessageHandler;
-import javax.websocket.SendHandler;
-import javax.websocket.SendResult;
 import javax.websocket.Session;
 import javax.websocket.WebSocketContainer;
 import javax.websocket.server.ServerEndpointConfig;
@@ -76,7 +74,7 @@ public class TestWsSessionSuspendResume extends 
WebSocketBaseTest {
 }
 });
 for (int i = 0; i < 8; i++) {
-wsSession.getAsyncRemote().sendText("echo");
+wsSession.getBasicRemote().sendText("echo");
 }
 
 boolean latchResult = latch.await(30, TimeUnit.SECONDS);
@@ -144,15 +142,13 @@ public class TestWsSessionSuspendResume extends 
WebSocketBaseTest {
 void addMessage(String message) {
 if (messages.size() == count) {
 ((WsSession) session).suspend();
-session.getAsyncRemote().sendText(messages.toString(), new 
SendHandler() {
-
-@Override
-public void onResult(SendResult result) {
-((WsSession) session).resume();
-Assert.assertTrue(result.isOK());
-}
-});
-messages.clear();
+try {
+session.getBasicRemote().sendText(messages.toString());
+messages.clear();
+((WsSession) session).resume();
+} catch (IOException e) {
+Assert.fail();
+}
 } else {
 messages.add(message);
 }


-
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

2020-06-25 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/5272

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] fea812963e0142f3770a0b778b1b08acba8ec1cb
Blamelist: Mark Thomas 

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



[tomcat] 01/02: Add the plumbing to 'recycle' an HTTP/2 Stream

2020-06-25 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 d88e0840c0278ed72fb14d9bf65b67097fe5a0bb
Author: Mark Thomas 
AuthorDate: Thu Jun 25 11:57:58 2020 +0100

Add the plumbing to 'recycle' an HTTP/2 Stream
---
 java/org/apache/coyote/http2/Stream.java  | 13 +
 java/org/apache/coyote/http2/StreamProcessor.java |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 32de3fe..5f28617 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -681,6 +681,19 @@ public class Stream extends AbstractStream implements 
HeaderEmitter {
 if (inputBuffer != null) {
 inputBuffer.receiveReset();
 }
+recycle();
+}
+
+
+/*
+ * This method is called recycle for consistency with the rest of the 
Tomcat
+ * code base. Currently, it only sets references to null for the purposes 
of
+ * reducing memory footprint. It does not fully recycle the Stream ready 
for
+ * re-use since Stream objects are not re-used.
+ */
+final void recycle() {
+// Currently a NO-OP. This will change shortly to address the TODO for
+// nulling out references.
 }
 
 
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 0106cf4..5a24f44 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -86,6 +86,9 @@ class StreamProcessor extends AbstractProcessor {
 stream.getIdAsInt());
 }
 stream.close(se);
+} else {
+// stream.close() will call recycle so only need 
it here
+stream.recycle();
 }
 }
 } catch (Exception e) {


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



[tomcat] branch 8.5.x updated (abdd02d -> 112992d)

2020-06-25 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 abdd02d  Make sure recycle() is called once the Stream is closed
 new d88e084  Add the plumbing to 'recycle' an HTTP/2 Stream
 new 112992d  Reduce the memory footprint of closed HTTP/2 streams

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:
 java/org/apache/coyote/http2/Stream.java  | 34 ++-
 java/org/apache/coyote/http2/StreamProcessor.java |  3 ++
 webapps/docs/changelog.xml|  3 ++
 3 files changed, 33 insertions(+), 7 deletions(-)


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



[tomcat] 02/02: Reduce the memory footprint of closed HTTP/2 streams

2020-06-25 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 112992d9e16c76bd3546499477f29ef864bf25ac
Author: Mark Thomas 
AuthorDate: Thu Jun 25 14:40:27 2020 +0100

Reduce the memory footprint of closed HTTP/2 streams
---
 java/org/apache/coyote/http2/Stream.java | 27 +--
 webapps/docs/changelog.xml   |  3 +++
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 5f28617..bf13b11 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -74,13 +74,15 @@ public class Stream extends AbstractStream implements 
HeaderEmitter {
 // State machine would be too much overhead
 private int headerState = HEADER_STATE_START;
 private StreamException headerException = null;
-// TODO: null these when finished to reduce memory used by closed stream
-private final Request coyoteRequest;
-private StringBuilder cookieHeader = null;
-private final Response coyoteResponse = new Response();
-private final StreamInputBuffer inputBuffer;
-private final StreamOutputBuffer streamOutputBuffer = new 
StreamOutputBuffer();
-private final Http2OutputBuffer http2OutputBuffer =
+
+// These will be set to null once the Stream closes to reduce the memory
+// footprint.
+private volatile Request coyoteRequest;
+private volatile StringBuilder cookieHeader = null;
+private volatile Response coyoteResponse = new Response();
+private volatile StreamInputBuffer inputBuffer;
+private volatile StreamOutputBuffer streamOutputBuffer = new 
StreamOutputBuffer();
+private volatile Http2OutputBuffer http2OutputBuffer =
 new Http2OutputBuffer(coyoteResponse, streamOutputBuffer);
 
 
@@ -689,11 +691,16 @@ public class Stream extends AbstractStream implements 
HeaderEmitter {
  * This method is called recycle for consistency with the rest of the 
Tomcat
  * code base. Currently, it only sets references to null for the purposes 
of
  * reducing memory footprint. It does not fully recycle the Stream ready 
for
- * re-use since Stream objects are not re-used.
+ * re-use since Stream objects are not re-used. This is useful because
+ * Stream instances are retained for a period after the Stream closes.
  */
 final void recycle() {
-// Currently a NO-OP. This will change shortly to address the TODO for
-// nulling out references.
+coyoteRequest = null;
+cookieHeader = null;
+coyoteResponse = null;
+inputBuffer = null;
+streamOutputBuffer = null;
+http2OutputBuffer = null;
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 3a1dd94..15f36ae 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -100,6 +100,9 @@
 Once an HTTP/2 stream has been closed, ensure that the code that cleans
 up references that are no longer required is called. (markt)
   
+  
+Reduce the memory footprint of closed HTTP/2 streams. (markt)
+  
 
   
   


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



[tomcat] 01/02: Add the plumbing to 'recycle' an HTTP/2 Stream

2020-06-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 61980cdfdcdada9cd023d30ab5af35010b1e084b
Author: Mark Thomas 
AuthorDate: Thu Jun 25 11:57:58 2020 +0100

Add the plumbing to 'recycle' an HTTP/2 Stream
---
 java/org/apache/coyote/http2/Stream.java  | 13 +
 java/org/apache/coyote/http2/StreamProcessor.java |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 65d636d..878fd2f 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -725,6 +725,19 @@ class Stream extends AbstractStream implements 
HeaderEmitter {
 } else {
 handler.closeConnection(http2Exception);
 }
+recycle();
+}
+
+
+/*
+ * This method is called recycle for consistency with the rest of the 
Tomcat
+ * code base. Currently, it only sets references to null for the purposes 
of
+ * reducing memory footprint. It does not fully recycle the Stream ready 
for
+ * re-use since Stream objects are not re-used.
+ */
+final void recycle() {
+// Currently a NO-OP. This will change shortly to address the TODO for
+// nulling out references.
 }
 
 
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 80c22ec..2b41753 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -89,6 +89,9 @@ class StreamProcessor extends AbstractProcessor {
 stream.getIdAsInt());
 }
 stream.close(se);
+} else {
+// stream.close() will call recycle so only need 
it here
+stream.recycle();
 }
 }
 } catch (Exception e) {


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



[tomcat] 02/02: Reduce the memory footprint of closed HTTP/2 streams

2020-06-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit e57d32d8636811ad26128dab53ca06c71437aa5e
Author: Mark Thomas 
AuthorDate: Thu Jun 25 14:40:27 2020 +0100

Reduce the memory footprint of closed HTTP/2 streams
---
 java/org/apache/coyote/http2/Stream.java | 27 +--
 webapps/docs/changelog.xml   |  3 +++
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 878fd2f..1ddf994 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -77,13 +77,15 @@ class Stream extends AbstractStream implements 
HeaderEmitter {
 // State machine would be too much overhead
 private int headerState = HEADER_STATE_START;
 private StreamException headerException = null;
-// TODO: null these when finished to reduce memory used by closed stream
-private final Request coyoteRequest;
-private StringBuilder cookieHeader = null;
-private final Response coyoteResponse = new Response();
-private final StreamInputBuffer inputBuffer;
-private final StreamOutputBuffer streamOutputBuffer = new 
StreamOutputBuffer();
-private final Http2OutputBuffer http2OutputBuffer =
+
+// These will be set to null once the Stream closes to reduce the memory
+// footprint.
+private volatile Request coyoteRequest;
+private volatile StringBuilder cookieHeader = null;
+private volatile Response coyoteResponse = new Response();
+private volatile StreamInputBuffer inputBuffer;
+private volatile StreamOutputBuffer streamOutputBuffer = new 
StreamOutputBuffer();
+private volatile Http2OutputBuffer http2OutputBuffer =
 new Http2OutputBuffer(coyoteResponse, streamOutputBuffer);
 
 
@@ -733,11 +735,16 @@ class Stream extends AbstractStream implements 
HeaderEmitter {
  * This method is called recycle for consistency with the rest of the 
Tomcat
  * code base. Currently, it only sets references to null for the purposes 
of
  * reducing memory footprint. It does not fully recycle the Stream ready 
for
- * re-use since Stream objects are not re-used.
+ * re-use since Stream objects are not re-used. This is useful because
+ * Stream instances are retained for a period after the Stream closes.
  */
 final void recycle() {
-// Currently a NO-OP. This will change shortly to address the TODO for
-// nulling out references.
+coyoteRequest = null;
+cookieHeader = null;
+coyoteResponse = null;
+inputBuffer = null;
+streamOutputBuffer = null;
+http2OutputBuffer = null;
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 52b1a30..dca98a2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -104,6 +104,9 @@
 Once an HTTP/2 stream has been closed, ensure that the code that cleans
 up references that are no longer required is called. (markt)
   
+  
+Reduce the memory footprint of closed HTTP/2 streams. (markt)
+  
 
   
   


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



[tomcat] branch 9.0.x updated (1094d17 -> e57d32d)

2020-06-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 1094d17  Update Graal documentation to reflect changes
 new 61980cd  Add the plumbing to 'recycle' an HTTP/2 Stream
 new e57d32d  Reduce the memory footprint of closed HTTP/2 streams

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:
 java/org/apache/coyote/http2/Stream.java  | 34 ++-
 java/org/apache/coyote/http2/StreamProcessor.java |  3 ++
 webapps/docs/changelog.xml|  3 ++
 3 files changed, 33 insertions(+), 7 deletions(-)


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



[tomcat] branch master updated (6a3cae6 -> fea8129)

2020-06-25 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 6a3cae6  Update Graal documentation to reflect changes
 add 3df857f  Add the plumbing to 'recycle' an HTTP/2 Stream
 add fea8129  Reduce the memory footprint of closed HTTP/2 streams

No new revisions were added by this update.

Summary of changes:
 java/org/apache/coyote/http2/Stream.java  | 34 ++-
 java/org/apache/coyote/http2/StreamProcessor.java |  3 ++
 webapps/docs/changelog.xml|  3 ++
 3 files changed, 33 insertions(+), 7 deletions(-)


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



buildbot success in on tomcat-trunk

2020-06-25 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/5271

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] 6a3cae6adf866a40eed8df3a571253bc295ec421
Blamelist: remm 

Build succeeded!

Sincerely,
 -The Buildbot




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



[GitHub] [tomcat] rmaucher commented on pull request #307: github actions

2020-06-25 Thread GitBox


rmaucher commented on pull request #307:
URL: https://github.com/apache/tomcat/pull/307#issuecomment-649544386


   Nice, so it would seem it takes about 8 minutes now, down from 30 minutes 
initially. Eventually more "unimportant" tests could be excluded to get this 
down. I got confused with the "Container.tests" but that was just another 
branch name.



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.

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



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



[GitHub] [tomcat] rotty3000 commented on pull request #307: github actions

2020-06-25 Thread GitBox


rotty3000 commented on pull request #307:
URL: https://github.com/apache/tomcat/pull/307#issuecomment-649530867


   @rmaucher I have made the requested changes:
   - only trunk
   - use nio
   - excluded tests slower than 5 seconds



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.

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



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



[tomcat] branch 9.0.x updated (dd35fd4 -> 1094d17)

2020-06-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


from dd35fd4  Make sure recycle() is called once the Stream is closed
 new 9eec670  Delete AOT Maven packaging from 9
 new 1094d17  Update Graal documentation to reflect changes

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:
 res/tomcat-maven/Dockerfile |  56 
 res/tomcat-maven/DockerfileGraal|  40 
 res/tomcat-maven/README.md  |  88 -
 res/tomcat-maven/graal-webapp.ant.xml   |  50 --
 res/tomcat-maven/pom.xml| 111 
 res/tomcat-maven/tomcat-jni.json|   7 --
 res/tomcat-maven/tomcat-reflection.json |  51 ---
 res/tomcat-maven/tomcat-resource.json   |  82 ---
 res/tomcat-maven/tomcat.yaml|  36 ---
 webapps/docs/graal.xml  |  70 +---
 10 files changed, 48 insertions(+), 543 deletions(-)
 delete mode 100644 res/tomcat-maven/Dockerfile
 delete mode 100644 res/tomcat-maven/DockerfileGraal
 delete mode 100644 res/tomcat-maven/README.md
 delete mode 100644 res/tomcat-maven/graal-webapp.ant.xml
 delete mode 100644 res/tomcat-maven/pom.xml
 delete mode 100644 res/tomcat-maven/tomcat-jni.json
 delete mode 100644 res/tomcat-maven/tomcat-reflection.json
 delete mode 100644 res/tomcat-maven/tomcat-resource.json
 delete mode 100644 res/tomcat-maven/tomcat.yaml


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



[tomcat] 02/02: Update Graal documentation to reflect changes

2020-06-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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

commit 1094d17cfbdfbbc635582fd133612e4b5907ea7d
Author: remm 
AuthorDate: Thu Jun 25 14:57:54 2020 +0200

Update Graal documentation to reflect changes
---
 webapps/docs/graal.xml | 70 ++
 1 file changed, 48 insertions(+), 22 deletions(-)

diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index 0d9535f..442ba22 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -35,7 +35,7 @@
   
 
   
-Tomcat supports using the GraalVM Native Image tool to produce
+Tomcat supports using the GraalVM/Mandrel Native Image tool to produce
 a native binary including the container. This documentation page
 describes the build process of such an image.
   
@@ -49,21 +49,31 @@
 the process will use the Maven shade plugin JAR packaging (fat JAR). The
 idea is to produce a single JAR that contains all necessary classes from
 Tomcat, the webapps and all additional dependencies. Although Tomcat has
-received compatibility fixes to support GraalVM native images, any library
+received compatibility fixes to support native images, any library
 may not be compatible and may require replacement code (the GraalVM
 documentation has more details about this).
   
 
   
-Download and install GraalVM. The first step is then to add the
-native-image tool.
-export JAVA_HOME=/absolute...path...to/graalvm-ce-javaX-x.y.z
+Download and install GraalVM or Mandrel.
+  
+
+  
+   If using GraalVM, the first step is then to add the Native Image tool.
+   export JAVA_HOME=/absolute...path...to/graalvm-ce-javaX-x.y.z
 cd $JAVA_HOME/bin
 ./gu install native-image
-Download the Tomcat Maven packaging from
-https://github.com/apache/tomcat/tree/master/res/tomcat-maven and place
-all the files in a folder (named tomcat-maven in this documentation.
-export TOMCAT_MAVEN=/absolute...path...to/tomcat-maven
+   Mandrel already includes the Native Image tool ready to use, so this
+   step can be skipped. Only JAVA_HOME must be set to the mandrelJDK folder,
+   such as:
+   export 
JAVA_HOME=/absolute...path...to/mandrel-javaXX-platform-x.x.x.x
+  
+
+  
+Download the Tomcat Stuffed module from
+https://github.com/apache/tomcat/tree/master/modules/stuffed and place
+all the files in a folder stuffed in this documentation.
+export TOMCAT_STUFFED=/absolute...path...to/stuffed
 The build process now requires both Ant and Maven.
   
 
@@ -72,7 +82,7 @@ cd $JAVA_HOME/bin
   
 
   
-Inside the tomcat-maven folder, the directory structure is the same as for
+Inside the tomcat-stuffed folder, the directory structure is the same as 
for
 regular Tomcat. The main configuration files are placed in the conf folder,
 and if using the default server.xml the webapps are placed in the webapps
 folder.
@@ -81,14 +91,28 @@ cd $JAVA_HOME/bin
   
 The first step is to build the fat Tomcat JAR with all dependencies.
 Any JSP in the webapp must all be precompiled and packaged.
-cd $TOMCAT_MAVEN
+cd $TOMCAT_STUFFED
 mvn package
-ant -Dwebapp.name=somewebapp -f graal-webapp.ant.xml
+ant -Dwebapp.name=somewebapp -f webapp-jspc.ant.xml
 Dependencies for the webapp should now be added to the main pom.xml,
 following with building the complete fat JAR.
 mvn package
   
 
+  
+As it is best to avoid using reflection whenever possible with Ahead of
+Time compilation, it can be a good idea to generate and compile Tomcat
+Embedded code out of the main server.xml configuration as well as the
+context.xml files used to configure the contexts.
+$JAVA_HOME/bin/java\
+-Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties\
+-jar target/tomcat-stuffed-1.0.jar --catalina -generateCode 
src/main/java
+mvn package
+The rest of the process described here will assume this step was done and
+the --catalina -useGeneratedCode arguments are added to the
+command lines. If this was not the case, they should be removed.
+  
+
   
 
   
@@ -103,9 +127,9 @@ ant -Dwebapp.name=somewebapp -f 
graal-webapp.ant.xml
   
 Run the GraalVM substrate VM using the trace agent:
 $JAVA_HOME/bin/java\
--agentlib:native-image-agent=config-output-dir=$TOMCAT_MAVEN/target/\
+-agentlib:native-image-agent=config-output-dir=$TOMCAT_STUFFED/target/\
 -Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties\
--jar target/tomcat-maven-1.0.jar
+-jar target/tomcat-stuffed-1.0.jar --catalina 
-useGeneratedCode
   
 
   
@@ -136,18 +160,18 @@ ant -Dwebapp.name=somewebapp -f 
graal-webapp.ant.xml
 

[tomcat] 01/02: Delete AOT Maven packaging from 9

2020-06-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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

commit 9eec670512e044b0dc7f9e943375cf882e88e430
Author: remm 
AuthorDate: Thu Jun 25 15:00:25 2020 +0200

Delete AOT Maven packaging from 9

For now, it doesn't need separate duplicate instructions and
configuration, so no need to not use it from trunk.
---
 res/tomcat-maven/Dockerfile |  56 
 res/tomcat-maven/DockerfileGraal|  40 
 res/tomcat-maven/README.md  |  88 -
 res/tomcat-maven/graal-webapp.ant.xml   |  50 --
 res/tomcat-maven/pom.xml| 111 
 res/tomcat-maven/tomcat-jni.json|   7 --
 res/tomcat-maven/tomcat-reflection.json |  51 ---
 res/tomcat-maven/tomcat-resource.json   |  82 ---
 res/tomcat-maven/tomcat.yaml|  36 ---
 9 files changed, 521 deletions(-)

diff --git a/res/tomcat-maven/Dockerfile b/res/tomcat-maven/Dockerfile
deleted file mode 100644
index 512f232..000
--- a/res/tomcat-maven/Dockerfile
+++ /dev/null
@@ -1,56 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-FROM openjdk:8-jre-alpine
-VOLUME /tmp
-
-USER root
-RUN mkdir -m 777 -p /deployments
-
-ADD target/tomcat-maven-1.0.jar /deployments/app.jar
-ADD conf /deployments/conf
-ADD webapps /deployments/webapps
-RUN chmod 777 /deployments/webapps
-
-WORKDIR /deployments
-
-ARG namespace=tomcat
-ENV KUBERNETES_NAMESPACE=$namespace
-ARG port=8080
-EXPOSE $port
-
-ENV JAVA_OPTS="-Dcatalina.base=. -Djava.security.egd=file:/dev/urandom"
-
-# Add JULI logging configuration
-ENV JAVA_OPTS="${JAVA_OPTS} 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
-Djava.util.logging.config.file=conf/logging.properties"
-
-RUN sh -c 'touch app.jar'
-
-RUN mkdir -p /opt
-
-# Optional: Add Jolokia agent for JMX monitoring and management
-# RUN mkdir /opt/jolokia && wget 
https://repo.maven.apache.org/maven2/org/jolokia/jolokia-jvm/1.6.2/jolokia-jvm-1.6.2-agent.jar
 -O /opt/jolokia/jolokia.jar
-# ARG jolokiaport=8778
-# ENV 
JAVA_OPTS="-javaagent:/opt/jolokia/jolokia.jar=host=*,port=$jolokiaport,protocol=https,authIgnoreCerts=true
 ${JAVA_OPTS}"
-# EXPOSE $jolokiaport
-
-# Optional: Add Prometheus agent for JMX monitoring
-# RUN mkdir /opt/prometheus && wget 
https://repo.maven.apache.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.12.0/jmx_prometheus_javaagent-0.12.0.jar
 -O /opt/prometheus/prometheus.jar && wget 
https://raw.githubusercontent.com/prometheus/jmx_exporter/master/example_configs/tomcat.yml
 -O conf/prometheus.yaml
-# ARG prometheusport=9404
-# ENV 
JAVA_OPTS="-javaagent:/opt/prometheus/prometheus.jar=$prometheusport:conf/prometheus.yaml
 ${JAVA_OPTS}"
-# EXPOSE $prometheusport
-
-ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -jar app.jar" ]
diff --git a/res/tomcat-maven/DockerfileGraal b/res/tomcat-maven/DockerfileGraal
deleted file mode 100644
index b801aa3..000
--- a/res/tomcat-maven/DockerfileGraal
+++ /dev/null
@@ -1,40 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-FROM busybox:glibc
-
-VOLUME /tmp
-
-USER root
-RUN mkdir -m 777 -p /deployments
-
-ADD tomcat-maven-1.0 /deployments/app
-ADD conf /deployments/conf
-ADD webapps /deployments/webapps
-
-WORKDIR /deployments
-
-ARG namespace=tomcat
-ENV KUBERNETES_NAMESPACE=$namespace
-ARG 

[tomcat] branch master updated: Update Graal documentation to reflect changes

2020-06-25 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 6a3cae6  Update Graal documentation to reflect changes
6a3cae6 is described below

commit 6a3cae6adf866a40eed8df3a571253bc295ec421
Author: remm 
AuthorDate: Thu Jun 25 14:57:54 2020 +0200

Update Graal documentation to reflect changes
---
 webapps/docs/graal.xml | 70 ++
 1 file changed, 48 insertions(+), 22 deletions(-)

diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index 0852595..b89dc1d 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -35,7 +35,7 @@
   
 
   
-Tomcat supports using the GraalVM Native Image tool to produce
+Tomcat supports using the GraalVM/Mandrel Native Image tool to produce
 a native binary including the container. This documentation page
 describes the build process of such an image.
   
@@ -49,21 +49,31 @@
 the process will use the Maven shade plugin JAR packaging (fat JAR). The
 idea is to produce a single JAR that contains all necessary classes from
 Tomcat, the webapps and all additional dependencies. Although Tomcat has
-received compatibility fixes to support GraalVM native images, any library
+received compatibility fixes to support native images, any library
 may not be compatible and may require replacement code (the GraalVM
 documentation has more details about this).
   
 
   
-Download and install GraalVM. The first step is then to add the
-native-image tool.
-export JAVA_HOME=/absolute...path...to/graalvm-ce-javaX-x.y.z
+Download and install GraalVM or Mandrel.
+  
+
+  
+   If using GraalVM, the first step is then to add the Native Image tool.
+   export JAVA_HOME=/absolute...path...to/graalvm-ce-javaX-x.y.z
 cd $JAVA_HOME/bin
 ./gu install native-image
-Download the Tomcat Maven packaging from
-https://github.com/apache/tomcat/tree/master/res/tomcat-maven and place
-all the files in a folder (named tomcat-maven in this documentation.
-export TOMCAT_MAVEN=/absolute...path...to/tomcat-maven
+   Mandrel already includes the Native Image tool ready to use, so this
+   step can be skipped. Only JAVA_HOME must be set to the mandrelJDK folder,
+   such as:
+   export 
JAVA_HOME=/absolute...path...to/mandrel-javaXX-platform-x.x.x.x
+  
+
+  
+Download the Tomcat Stuffed module from
+https://github.com/apache/tomcat/tree/master/modules/stuffed and place
+all the files in a folder stuffed in this documentation.
+export TOMCAT_STUFFED=/absolute...path...to/stuffed
 The build process now requires both Ant and Maven.
   
 
@@ -72,7 +82,7 @@ cd $JAVA_HOME/bin
   
 
   
-Inside the tomcat-maven folder, the directory structure is the same as for
+Inside the tomcat-stuffed folder, the directory structure is the same as 
for
 regular Tomcat. The main configuration files are placed in the conf folder,
 and if using the default server.xml the webapps are placed in the webapps
 folder.
@@ -81,14 +91,28 @@ cd $JAVA_HOME/bin
   
 The first step is to build the fat Tomcat JAR with all dependencies.
 Any JSP in the webapp must all be precompiled and packaged.
-cd $TOMCAT_MAVEN
+cd $TOMCAT_STUFFED
 mvn package
-ant -Dwebapp.name=somewebapp -f graal-webapp.ant.xml
+ant -Dwebapp.name=somewebapp -f webapp-jspc.ant.xml
 Dependencies for the webapp should now be added to the main pom.xml,
 following with building the complete fat JAR.
 mvn package
   
 
+  
+As it is best to avoid using reflection whenever possible with Ahead of
+Time compilation, it can be a good idea to generate and compile Tomcat
+Embedded code out of the main server.xml configuration as well as the
+context.xml files used to configure the contexts.
+$JAVA_HOME/bin/java\
+-Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties\
+-jar target/tomcat-stuffed-1.0.jar --catalina -generateCode 
src/main/java
+mvn package
+The rest of the process described here will assume this step was done and
+the --catalina -useGeneratedCode arguments are added to the
+command lines. If this was not the case, they should be removed.
+  
+
   
 
   
@@ -103,9 +127,9 @@ ant -Dwebapp.name=somewebapp -f 
graal-webapp.ant.xml
   
 Run the GraalVM substrate VM using the trace agent:
 $JAVA_HOME/bin/java\
--agentlib:native-image-agent=config-output-dir=$TOMCAT_MAVEN/target/\
+-agentlib:native-image-agent=config-output-dir=$TOMCAT_STUFFED/target/\
 -Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties\
--jar target/tomcat-maven-1.0.jar
+-jar target/tomcat-stuffed-1.0.jar --catalina 
-useGeneratedCode
   
 
   
@@ -136,18 +160,18 @@ ant 

[tomcat] branch master updated: Move AOT compilation packaging to a new module

2020-06-25 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 a1a4457  Move AOT compilation packaging to a new module
a1a4457 is described below

commit a1a445749526a4497908270e3b2bfbff15066b8a
Author: remm 
AuthorDate: Thu Jun 25 14:56:54 2020 +0200

Move AOT compilation packaging to a new module

Also cleanup and improvements based on newest changes.
---
 {res/tomcat-maven => modules/stuffed}/Dockerfile|  6 +++---
 {res/tomcat-maven => modules/stuffed}/DockerfileGraal   |  5 +++--
 {res/tomcat-maven => modules/stuffed}/README.md |  8 
 {res/tomcat-maven => modules/stuffed}/pom.xml   | 17 ++---
 {res/tomcat-maven => modules/stuffed}/tomcat-jni.json   |  0
 .../stuffed}/tomcat-reflection.json |  0
 .../stuffed}/tomcat-resource.json   |  0
 {res/tomcat-maven => modules/stuffed}/tomcat.yaml   |  2 +-
 .../stuffed/webapp-jspc.ant.xml |  6 +++---
 9 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/res/tomcat-maven/Dockerfile b/modules/stuffed/Dockerfile
similarity index 91%
rename from res/tomcat-maven/Dockerfile
rename to modules/stuffed/Dockerfile
index 512f232..83e5b6e 100644
--- a/res/tomcat-maven/Dockerfile
+++ b/modules/stuffed/Dockerfile
@@ -14,13 +14,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM openjdk:8-jre-alpine
+FROM openjdk:8-jre
 VOLUME /tmp
 
 USER root
 RUN mkdir -m 777 -p /deployments
 
-ADD target/tomcat-maven-1.0.jar /deployments/app.jar
+ADD target/tomcat-stuffed-1.0.jar /deployments/app.jar
 ADD conf /deployments/conf
 ADD webapps /deployments/webapps
 RUN chmod 777 /deployments/webapps
@@ -48,7 +48,7 @@ RUN mkdir -p /opt
 # EXPOSE $jolokiaport
 
 # Optional: Add Prometheus agent for JMX monitoring
-# RUN mkdir /opt/prometheus && wget 
https://repo.maven.apache.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.12.0/jmx_prometheus_javaagent-0.12.0.jar
 -O /opt/prometheus/prometheus.jar && wget 
https://raw.githubusercontent.com/prometheus/jmx_exporter/master/example_configs/tomcat.yml
 -O conf/prometheus.yaml
+# RUN mkdir /opt/prometheus && wget 
https://repo.maven.apache.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.13.0/jmx_prometheus_javaagent-0.13.0.jar
 -O /opt/prometheus/prometheus.jar && wget 
https://raw.githubusercontent.com/prometheus/jmx_exporter/master/example_configs/tomcat.yml
 -O conf/prometheus.yaml
 # ARG prometheusport=9404
 # ENV 
JAVA_OPTS="-javaagent:/opt/prometheus/prometheus.jar=$prometheusport:conf/prometheus.yaml
 ${JAVA_OPTS}"
 # EXPOSE $prometheusport
diff --git a/res/tomcat-maven/DockerfileGraal b/modules/stuffed/DockerfileGraal
similarity index 88%
rename from res/tomcat-maven/DockerfileGraal
rename to modules/stuffed/DockerfileGraal
index b801aa3..19e2353 100644
--- a/res/tomcat-maven/DockerfileGraal
+++ b/modules/stuffed/DockerfileGraal
@@ -21,7 +21,7 @@ VOLUME /tmp
 USER root
 RUN mkdir -m 777 -p /deployments
 
-ADD tomcat-maven-1.0 /deployments/app
+ADD tomcat-stuffed-1.0 /deployments/app
 ADD conf /deployments/conf
 ADD webapps /deployments/webapps
 
@@ -33,8 +33,9 @@ ARG port=8080
 EXPOSE $port
 
 ENV JAVA_OPTS="-Dcatalina.base=. -Djava.security.egd=file:/dev/urandom"
+ENV CATALINA_OPTS="--catalina -useGeneratedCode"
 
 # Add JULI logging configuration
 ENV JAVA_OPTS="${JAVA_OPTS} 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
-Djava.util.logging.config.file=conf/logging.properties"
 
-ENTRYPOINT [ "sh", "-c", "/deployments/app $JAVA_OPTS" ]
+ENTRYPOINT [ "sh", "-c", "/deployments/app $JAVA_OPTS $CATALINA_OPTS" ]
diff --git a/res/tomcat-maven/README.md b/modules/stuffed/README.md
similarity index 93%
rename from res/tomcat-maven/README.md
rename to modules/stuffed/README.md
index b5e54f7..7e50576 100644
--- a/res/tomcat-maven/README.md
+++ b/modules/stuffed/README.md
@@ -19,7 +19,7 @@
 
 -->
 
-# Apache Tomcat distribution for Apache Maven
+# Apache Tomcat distribution for container platforms
 
 ## Configuration
 
@@ -37,7 +37,7 @@ mvn clean; mvn package
 ### Docker build
 
 ```
-docker build -t apache/tomcat-maven:1.0 -f ./Dockerfile .
+docker build -t apache/tomcat-stuffed:1.0 -f ./Dockerfile .
 ```
 Docker build arguments include `namepsace` (default is `tomcat`) and `port` 
which should match the Tomcat port in `server.xml` (default is `8080`). Other 
ports that need to be exposed can be added in the `Dockerfile` as needed. 
Webapps should be added to the `webapps` folder where they will be auto 
deployed by the host if using the defaults. Otherwise, the `Dockerfile` command 
line can be edited like below to include the necesary resources and command 
line arguments to run a single or mu [...]
 
@@ -56,13 +56,13 @@ The 

[GitHub] [tomcat] rmaucher commented on pull request #307: github actions

2020-06-25 Thread GitBox


rmaucher commented on pull request #307:
URL: https://github.com/apache/tomcat/pull/307#issuecomment-649522279


   Looks good to me. Personally, I don't panic when I see a few random failures.
   
   Since this is meant as a smoke test, and in an effort to not spam too much 
about failures, I would do the following:
   - Only test trunk (development is supposed to happen there, so although 
there are backport problems sometimes, this is not that common and will be 
caught by the main CI rather quickly)
   - Use "test-nio", for some reason you use "test-nio2" which is not the 
default connector; but good idea on not testing all three connectors (or rather 
all six if you also include the JSSE/OpenSSL options
   - Exclude tests that need a long time to run



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.

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



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



Re: flaky HTTP2 test

2020-06-25 Thread Raymond Auge
Understood, sorry for the noise.

- Ray

On Thu, Jun 25, 2020, 02:27 Rémy Maucherat,  wrote:

> On Thu, Jun 25, 2020 at 3:28 AM Raymond Auge 
> wrote:
>
>> Sorry folks, but here are two more intermittent Http2 test failures:
>>
>> 2020-06-25T01:09:24.3494270Z[concat] Testsuites with failed tests:
>> 2020-06-25T01:09:24.3496415Z[concat] 
>> TEST-org.apache.coyote.http2.TestHttp2Section_5_3.NIO2.txt
>> 2020-06-25T01:09:24.3497981Z[concat] 
>> TEST-org.apache.coyote.http2.TestHttp2Section_6_1.NIO2.txt
>>
>> Full log:
>> https://gist.github.com/rotty3000/5fd2d101fab664707f024d3d3110bf86
>>
>> One benefit of running tests as quickly and often as possible is catching
>> these kinds of flaky tests.
>>
>> For reference https://github.com/rotty3000/tomcat/actions
>>
>
> You do not need to send an email every time a test fails. It's interesting
> and all, but until a test fails locally rather reliably I'm not actually
> going to do much about it.
>
> Rémy
>
>
>>
>> - Ray
>>
>>
>> On Wed, Jun 24, 2020 at 11:56 AM Raymond Auge 
>> wrote:
>>
>>> Sorry about that. I've copied the entire build log here
>>>
>>> https://gist.github.com/rotty3000/475d92ece3f41123e7092ab31ce30f53
>>>
>>> Hopefully you can see that one?
>>>
>>> - Ray
>>>
>>> On Wed, Jun 24, 2020 at 11:35 AM Eduardo Quintanilla <
>>> equintani...@bnext.mx> wrote:
>>>
 The link does not work.

 HTTP Status: 400
 Response: {"count":11,"value":"Uri expired"}

 Eduardo Quintanilla
 Software Developer

 From: Raymond Auge 
 Sent: miércoles, 24 de junio de 2020 10:29 a. m.
 To: Tomcat Developers List 
 Subject: Re: flaky HTTP2 test

 You'll notice that in the same run that test passed on JDK 14 and 15-ea.

 - Ray

 On Wed, Jun 24, 2020 at 11:26 AM Raymond Auge >>> raymond.a...@liferay.com> wrote:
 See
 https://pipelines.actions.githubusercontent.com/hQhYuytC86T1GsTs7qTvThq2ESqStTSskvOzwdA12PGOh7ZWVy/_apis/pipelines/1/runs/14/signedlogcontent/7?urlExpires=2020-06-24T15%3A25%3A51.1449322Z=HMACV1=O2PyO3WhK3FTDVz3t1sTeAGHP7IOlnynp8PZIfw%2BsOQ%3D

 and search for "Running org.apache.coyote.http2.TestHttp2Limits"

 - Ray

 On Wed, Jun 24, 2020 at 11:15 AM Mark Thomas 
 wrote:
 On 24/06/2020 15:56, Raymond Auge wrote:
 > Hey all,
 >
 > The test
 > org.apache.coyote.http2.TestHttp2Limits
 > seems to be flaky.

 Haven't seen any issues with it recently either locally or with on of
 the other CI systems.

 Do you have a log from a failure case?

 Mark

 >
 > I'm playing with github actions as per
 > https://github.com/apache/tomcat/pull/307
 > and I've observed that this test arbitrarily passes or fails.
 >
 > For now I will filter it out of my POC but I figured it might be
 > relevant to someone :)
 >
 > Sincerely,
 > --
 > *Raymond Augé*
 >  (@rotty3000)
 > Senior Software Architect *Liferay, Inc.*
 >  (@Liferay)


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


 --
 http://www.liferay.com/web/raymond.auge/profile (@rotty3000)
 Senior Software Architect http://www.liferay.com (@Liferay)


 --
 http://www.liferay.com/web/raymond.auge/profile (@rotty3000)
 Senior Software Architect http://www.liferay.com (@Liferay)


 The information transmitted is intended only for the person or entity
 to which it is addressed and may contain confidential and/or privileged
 material. Any review, retransmission, dissemination or other use of, or
 taking of any action in reliance upon, this information by persons or
 entities other than the intended recipient is prohibited. If you received
 this in error, please contact the sender and delete the material from any
 computer.
 La información transmitida está destinada únicamente a la persona o
 entidad a quien que va dirigida y puede contener información confidencial
 y/o material privilegiado. Cualquier revisión, retransmisión, difusión u
 otros usos, o cualquier acción tomada por personas o entidades distintas al
 destinatario basándose en esta información está prohibida. Si usted recibe
 este mensaje por error, por favor contacte al remitente y elimine el
 material de cualquier computadora.

>>>
>>>
>>> --
>>> *Raymond Augé* 
>>>  (@rotty3000)
>>> Senior Software Architect *Liferay, Inc.* 
>>>  (@Liferay)
>>>
>>
>>
>> --
>> *Raymond Augé* 
>>  (@rotty3000)
>> Senior Software Architect *Liferay, Inc.* 

buildbot failure in on tomcat-trunk

2020-06-25 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/5270

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] 785cc6e6094684d21ffd14d3594d19b2e93d
Blamelist: Mark Thomas 

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



[tomcat] branch 8.5.x updated: Make sure recycle() is called once the Stream is closed

2020-06-25 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 abdd02d  Make sure recycle() is called once the Stream is closed
abdd02d is described below

commit abdd02d564be967f15b3f67c5bc852842c6edf47
Author: Mark Thomas 
AuthorDate: Thu Jun 25 10:42:37 2020 +0100

Make sure recycle() is called once the Stream is closed
---
 java/org/apache/coyote/http2/StreamProcessor.java | 4 
 webapps/docs/changelog.xml| 4 
 2 files changed, 8 insertions(+)

diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 6839b43..0106cf4 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -97,7 +97,11 @@ class StreamProcessor extends AbstractProcessor {
 ConnectionException ce = new ConnectionException(msg, 
Http2Error.INTERNAL_ERROR);
 ce.initCause(e);
 stream.close(ce);
+state = SocketState.CLOSED;
 } finally {
+if (state == SocketState.CLOSED) {
+recycle();
+}
 ContainerThreadMarker.clear();
 }
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b7d2fea..3a1dd94 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -96,6 +96,10 @@
 white space around cookie attrubute names and values when using the RFC
 6265 cookie processor. (markt)
   
+  
+Once an HTTP/2 stream has been closed, ensure that the code that cleans
+up references that are no longer required is called. (markt)
+  
 
   
   


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



[Bug 64560] DeltaSession discards pending deltas when changeSessionId() is called

2020-06-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64560

Max Lohrmann  changed:

   What|Removed |Added

 CC||p...@wickenrode.com

-- 
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 9.0.x updated: Make sure recycle() is called once the Stream is closed

2020-06-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new dd35fd4  Make sure recycle() is called once the Stream is closed
dd35fd4 is described below

commit dd35fd4c406179b8457c724554bbe3c047e88964
Author: Mark Thomas 
AuthorDate: Thu Jun 25 10:42:37 2020 +0100

Make sure recycle() is called once the Stream is closed
---
 java/org/apache/coyote/http2/StreamProcessor.java | 4 
 webapps/docs/changelog.xml| 4 
 2 files changed, 8 insertions(+)

diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index e03f307..80c22ec 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -100,7 +100,11 @@ class StreamProcessor extends AbstractProcessor {
 ConnectionException ce = new ConnectionException(msg, 
Http2Error.INTERNAL_ERROR);
 ce.initCause(e);
 stream.close(ce);
+state = SocketState.CLOSED;
 } finally {
+if (state == SocketState.CLOSED) {
+recycle();
+}
 ContainerThreadMarker.clear();
 }
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a4daa3c..52b1a30 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -100,6 +100,10 @@
 white space around cookie attrubute names and values when using the RFC
 6265 cookie processor. (markt)
   
+  
+Once an HTTP/2 stream has been closed, ensure that the code that cleans
+up references that are no longer required is called. (markt)
+  
 
   
   


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



[tomcat] branch master updated: Make sure recycle() is called once the Stream is closed

2020-06-25 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


The following commit(s) were added to refs/heads/master by this push:
 new 785cc6e  Make sure recycle() is called once the Stream is closed
785cc6e is described below

commit 785cc6e6094684d21ffd14d3594d19b2e93d
Author: Mark Thomas 
AuthorDate: Thu Jun 25 10:42:37 2020 +0100

Make sure recycle() is called once the Stream is closed
---
 java/org/apache/coyote/http2/StreamProcessor.java | 4 
 webapps/docs/changelog.xml| 4 
 2 files changed, 8 insertions(+)

diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index e03f307..80c22ec 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -100,7 +100,11 @@ class StreamProcessor extends AbstractProcessor {
 ConnectionException ce = new ConnectionException(msg, 
Http2Error.INTERNAL_ERROR);
 ce.initCause(e);
 stream.close(ce);
+state = SocketState.CLOSED;
 } finally {
+if (state == SocketState.CLOSED) {
+recycle();
+}
 ContainerThreadMarker.clear();
 }
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 39b8245..5fee419 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -103,6 +103,10 @@
 white space around cookie attrubute names and values when using the RFC
 6265 cookie processor. (markt)
   
+  
+Once an HTTP/2 stream has been closed, ensure that the code that cleans
+up references that are no longer required is called. (markt)
+  
 
   
   


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



[Bug 64560] DeltaSession discards pending deltas when changeSessionId() is called

2020-06-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64560

--- Comment #1 from Max Lohrmann  ---
Sorry, typo. 
It should have said

removeAttribute("A");

above (not C).

-- 
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 64560] New: DeltaSession discards pending deltas when changeSessionId() is called

2020-06-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64560

Bug ID: 64560
   Summary: DeltaSession discards pending deltas when
changeSessionId() is called
   Product: Tomcat 9
   Version: 9.0.34
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Cluster
  Assignee: dev@tomcat.apache.org
  Reporter: p...@wickenrode.com
  Target Milestone: -

I had a problem in an application using Spring Security and using clustering
with DeltaManager where some attributes would be replicated while others would
not during login.

Basically what I was seeing was:

- First request to tomcat A
- Session attributes on both tomcats afterwards:
A=1
B=2

- Second request to tomcat A
- Session attributes on tomcat A afterwards:
C=1
B=3
- Session attributes on tomcat B afterwards:
A=1
B=3

Thus resulting in an invalid application state.

Using a debugger the calls on the session for the second request were:

removeAttribute("C");
setAttribute("C",1);
changeSessionId();
setAttribute("B",3);

So it looks like all attribute changes made before changeSessionId got lost in
replication.

After looking at the tomcat code I think this is an issue with tomcat, because
the changeSessionId calls DeltaSession#setId which in turn calls
DeltaSession#resetDeltaRequest() which then discards the buffered
AttributeInfo, so by the time the ReplicationValve is executed, only the last
setAttribute call is seen as a delta.

-- 
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



Re: flaky HTTP2 test

2020-06-25 Thread Rémy Maucherat
On Thu, Jun 25, 2020 at 3:28 AM Raymond Auge 
wrote:

> Sorry folks, but here are two more intermittent Http2 test failures:
>
> 2020-06-25T01:09:24.3494270Z[concat] Testsuites with failed tests:
> 2020-06-25T01:09:24.3496415Z[concat] 
> TEST-org.apache.coyote.http2.TestHttp2Section_5_3.NIO2.txt
> 2020-06-25T01:09:24.3497981Z[concat] 
> TEST-org.apache.coyote.http2.TestHttp2Section_6_1.NIO2.txt
>
> Full log:
> https://gist.github.com/rotty3000/5fd2d101fab664707f024d3d3110bf86
>
> One benefit of running tests as quickly and often as possible is catching
> these kinds of flaky tests.
>
> For reference https://github.com/rotty3000/tomcat/actions
>

You do not need to send an email every time a test fails. It's interesting
and all, but until a test fails locally rather reliably I'm not actually
going to do much about it.

Rémy


>
> - Ray
>
>
> On Wed, Jun 24, 2020 at 11:56 AM Raymond Auge 
> wrote:
>
>> Sorry about that. I've copied the entire build log here
>>
>> https://gist.github.com/rotty3000/475d92ece3f41123e7092ab31ce30f53
>>
>> Hopefully you can see that one?
>>
>> - Ray
>>
>> On Wed, Jun 24, 2020 at 11:35 AM Eduardo Quintanilla <
>> equintani...@bnext.mx> wrote:
>>
>>> The link does not work.
>>>
>>> HTTP Status: 400
>>> Response: {"count":11,"value":"Uri expired"}
>>>
>>> Eduardo Quintanilla
>>> Software Developer
>>>
>>> From: Raymond Auge 
>>> Sent: miércoles, 24 de junio de 2020 10:29 a. m.
>>> To: Tomcat Developers List 
>>> Subject: Re: flaky HTTP2 test
>>>
>>> You'll notice that in the same run that test passed on JDK 14 and 15-ea.
>>>
>>> - Ray
>>>
>>> On Wed, Jun 24, 2020 at 11:26 AM Raymond Auge >> raymond.a...@liferay.com> wrote:
>>> See
>>> https://pipelines.actions.githubusercontent.com/hQhYuytC86T1GsTs7qTvThq2ESqStTSskvOzwdA12PGOh7ZWVy/_apis/pipelines/1/runs/14/signedlogcontent/7?urlExpires=2020-06-24T15%3A25%3A51.1449322Z=HMACV1=O2PyO3WhK3FTDVz3t1sTeAGHP7IOlnynp8PZIfw%2BsOQ%3D
>>>
>>> and search for "Running org.apache.coyote.http2.TestHttp2Limits"
>>>
>>> - Ray
>>>
>>> On Wed, Jun 24, 2020 at 11:15 AM Mark Thomas 
>>> wrote:
>>> On 24/06/2020 15:56, Raymond Auge wrote:
>>> > Hey all,
>>> >
>>> > The test
>>> > org.apache.coyote.http2.TestHttp2Limits
>>> > seems to be flaky.
>>>
>>> Haven't seen any issues with it recently either locally or with on of
>>> the other CI systems.
>>>
>>> Do you have a log from a failure case?
>>>
>>> Mark
>>>
>>> >
>>> > I'm playing with github actions as per
>>> > https://github.com/apache/tomcat/pull/307
>>> > and I've observed that this test arbitrarily passes or fails.
>>> >
>>> > For now I will filter it out of my POC but I figured it might be
>>> > relevant to someone :)
>>> >
>>> > Sincerely,
>>> > --
>>> > *Raymond Augé*
>>> >  (@rotty3000)
>>> > Senior Software Architect *Liferay, Inc.*
>>> >  (@Liferay)
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: mailto:dev-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: mailto:dev-h...@tomcat.apache.org
>>>
>>>
>>> --
>>> http://www.liferay.com/web/raymond.auge/profile (@rotty3000)
>>> Senior Software Architect http://www.liferay.com (@Liferay)
>>>
>>>
>>> --
>>> http://www.liferay.com/web/raymond.auge/profile (@rotty3000)
>>> Senior Software Architect http://www.liferay.com (@Liferay)
>>>
>>>
>>> The information transmitted is intended only for the person or entity to
>>> which it is addressed and may contain confidential and/or privileged
>>> material. Any review, retransmission, dissemination or other use of, or
>>> taking of any action in reliance upon, this information by persons or
>>> entities other than the intended recipient is prohibited. If you received
>>> this in error, please contact the sender and delete the material from any
>>> computer.
>>> La información transmitida está destinada únicamente a la persona o
>>> entidad a quien que va dirigida y puede contener información confidencial
>>> y/o material privilegiado. Cualquier revisión, retransmisión, difusión u
>>> otros usos, o cualquier acción tomada por personas o entidades distintas al
>>> destinatario basándose en esta información está prohibida. Si usted recibe
>>> este mensaje por error, por favor contacte al remitente y elimine el
>>> material de cualquier computadora.
>>>
>>
>>
>> --
>> *Raymond Augé* 
>>  (@rotty3000)
>> Senior Software Architect *Liferay, Inc.* 
>>  (@Liferay)
>>
>
>
> --
> *Raymond Augé* 
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* 
>  (@Liferay)
>