Re: [VOTE] Private branches in the official Tomcat git repository

2019-10-11 Thread Chuck Caldarale
On Oct 11, 2019, at 09:20, Rémy Maucherat  wrote:

> This vote is to regulate the use of branches in the official Tomcat 
> repository beyond branches that are approved by the community 
> such as 8.5.x and 7.0.x. It is possible to do development in private 
> branches directly in the official Tomcat repository, as an alternative 
> to using forks and pull requests.

> Should private branches be allowed in the official Tomcat git repository ?
[ ] Yes
[x] No

I’m not a committer, so my vote doesn’t really count, but I am a long-time 
Tomcat user and occasional contributer (less these days due to work 
priorities). I find the use of personal branches in the public repository to be 
at best annoying.

  - Chuck


-
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: Tomcat 7.0.97 did not pass the vote

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

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 2dbbd1e  Tomcat 7.0.97 did not pass the vote
2dbbd1e is described below

commit 2dbbd1e5489b323c2cfc0fcafe410bb47ee99897
Author: Violeta Georgieva 
AuthorDate: Fri Oct 11 18:38:01 2019 -0500

Tomcat 7.0.97 did not pass the vote
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f87315d..b042f39 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -84,7 +84,7 @@
 
   
 
-
+
   
 
   


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



Re: [CANCEL][VOTE] Release Apache Tomcat 7.0.97

2019-10-11 Thread Violeta Georgieva
Hi,

На нд, 6.10.2019 г. в 5:01 ч. Violeta Georgieva 
написа:
>
> The proposed Apache Tomcat 7.0.97 release is now available for voting.
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.97/
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1232/
> The git tag is:
> https://github.com/apache/tomcat/tree/7.0.97
> 1cfec207b09fed52965f0d0426059ca989daf3b4
>
> The proposed 7.0.97 release is:
> [ ] Broken - do not release
> [ ] Stable - go ahead and release as 7.0.97 Stable

I'm canceling this vote in order to pick up fixes for the issues reported
by kkolinko and
guo xiong li

Regards,
Violeta


Re: [Bug 63833] NPE in DBCP when attempting to connect to a database that doesn't exist

2019-10-11 Thread Phil Steitz
How about adding the DBCP unit tests to the source tree?  I suspect some 
would have failed due to this change.  If others think this is a good 
idea, I could take a stab at genericising them and creating a PR to add 
them.


On 10/11/19 3:31 PM, bugzi...@apache.org wrote:

https://bz.apache.org/bugzilla/show_bug.cgi?id=63833

Phil Steitz  changed:

What|Removed |Added

  OS||All

--- Comment #2 from Phil Steitz  ---
This is a regression from the generics conversion in PoolableConnectionFactory.

The original DBCP 1.x code effectively null-checked the object to be destroyed:
 public void destroyObject(Object obj) throws Exception {
 if(obj instanceof PoolableConnection) {
 ((PoolableConnection)obj).reallyClose();
 }

Removing the instanceOf check makes NPE possible:
 public void destroyObject(PoolableConnection obj) throws Exception {
 obj.reallyClose();
 }

Solution is to add an explicit null check in destroyObject.

Similar changes should be made to activate, passivate, validate methods.




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



[Bug 63833] NPE in DBCP when attempting to connect to a database that doesn't exist

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

Phil Steitz  changed:

   What|Removed |Added

 OS||All

--- Comment #2 from Phil Steitz  ---
This is a regression from the generics conversion in PoolableConnectionFactory.

The original DBCP 1.x code effectively null-checked the object to be destroyed:
public void destroyObject(Object obj) throws Exception {
if(obj instanceof PoolableConnection) {
((PoolableConnection)obj).reallyClose();
}

Removing the instanceOf check makes NPE possible:
public void destroyObject(PoolableConnection obj) throws Exception {
obj.reallyClose();
}

Solution is to add an explicit null check in destroyObject.

Similar changes should be made to activate, passivate, validate methods.

-- 
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: [VOTE] Release Apache Tomcat 7.0.97

2019-10-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Guo,

On 10/11/19 09:18, guo xiong li wrote:
> The BZ-63833 describes a NullPointerException in branch 7.0.x.
> https://bz.apache.org/bugzilla/show_bug.cgi?id=63833
>
> It is better to solve it before release. I submit a patch to solve
> it just now. Hope it  can help.

Thanks for the patch.

This issue is minor enough that I don't think it needs to hold-up this
release.

I will defer to Violetta, the release-manager for this 7.0.x release,
to decide whether or not she thinks the release vote should be cancelled
.

- -chris

> On Fri, Oct 11, 2019 at 9:04 PM Konstantin Kolinko
> mailto:knst.koli...@gmail.com>> wrote:
>
> вс, 6 окт. 2019 г. в 13:01, Violeta Georgieva
> mailto:violet...@apache.org>>:
>>
>> The proposed Apache Tomcat 7.0.97 release is now available for
>> voting.
>>
>
> Thus far I ran the unit tests on Windows 10 with Java 6, 7, 8 and
> 13 for all connectors. All is good except the following:
>
> 1. TestWebdavServletOptions fails with OutOfMemoryError on 32-bit
> Java and NIO connector (Java 6, 7, 8).
>
> It is not a regression and I do not consider it a showstopper.
>
> Filed into Bugzilla:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=63836
>
> 2.TestAbstractAjpProcessor hangs with Java 13 and NIO.
>
> It would be better to fix this, if possible. It is also possible to
> release with this issue, but add a note to an announcement. I think
> that there exist a workaround by explicitly setting a timeout in
> server.xml.
>
> Filed into Bugzilla:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=63837
>
>
> 3. An Illegal reflective access warning for WebappClassLoaderBase
> with Java 13.
>
> Just a warning. I filed it as an enhancement request:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=63838
>
> Best regards, Konstantin Kolinko
>
> -
>
>
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands,
> e-mail: dev-h...@tomcat.apache.org
> 
>
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl2g7ncACgkQHPApP6U8
pFjBFhAAwftLn71x03U15iGHWfcedR6j3fZ/c6KyObr3C2coVVeOsZayxJEae/YQ
JUncICXSPmR2TXYO2lW/g2r06q8LzmoaffSGExcOThb9WYFsQc5PYXdupcCygpU6
8NL6q8AlgI28Mm0M4DN+PfA3eFuXtj9Rbk+z3D0cnQtCUJwhtLHfJz6ZVSPzFXBS
JjwOUbQTKZk2lXBSu8WOdzUUdowsI7+Z9lEU4Pe4ZslDELYXEFjRcMAqWlrK3pBq
JgzuCD6q0p1QnrscMyb1i3W8B0Putj/vRySt/pNOjjPBUQTbYspeopr2S2udpco9
UjMIUx60pU9VSz4tg6JAYufcQiMSKqCOzzUfkjhIFId8PphOAeMmNPmvGr5iElRA
e8mWnxt5PSH+Qhkp46CbmwgKFjDic/WzKGFhSnyWQHqPiW3rIClLNNwjgy3QTzZZ
XqY7qE98WE1ZDr0l5g/+G4gkgJtOkieji7z9NLLqxUMXXxGrDRJWoZPNwvtS3gUM
sKMPRPC7pV3WtDK8wKRY3YGarg9Un2Rb1q9Rmqx4YFrZaFjum3DPZZFOCuIzPtn1
TNHBIV7PeOamnaqtF3JBif7WT81OA8X5roONAcEJ/0Vi1CzJtKZtMaU1hwvoOhll
Sqj83fMpIHg2UrE8dA982oFZfUiq6CqV5Ix9DO9/ugmpK2kwWso=
=h49m
-END PGP SIGNATURE-

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



Re: [VOTE] Private branches in the official Tomcat git repository

2019-10-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Rémy,

On 10/11/19 10:20, Rémy Maucherat wrote:
> Hi,
>
> This vote is to regulate the use of branches in the official
> Tomcat repository beyond branches that are approved by the
> community such as 8.5.x and 7.0.x. It is possible to do development
> in private branches directly in the official Tomcat repository, as
> an alternative to using forks and pull requests.
>
> Should private branches be allowed in the official Tomcat git
> repository ? [ ] Yes [X] No

I don't think it makes any sense to have non-standard branches in the
public git repository.

If you want to make a branch in your own fork, then merge back to one
of the "official" branches, then PR to upstream, that makes sense to me.

But I don't see any need to create additional "public" branches in the
apache/tomcat repo.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl2g7XsACgkQHPApP6U8
pFijhBAAyDhBffk317kp64U3ILsaNQ12dh3LyGiNP/12D+bGISRlNu7eRnpNFI9W
ig5Acv0mTfO2QhEf9iGjnhZFYcPRabIScIOd5qVSgtKew+9cL7of2HgnOPI8vu2X
IwK/I8v+yevEbUDuUEGQ4Zz4zaZAHi8HvynUklMcPYZzp3haEby2HYe41v/lXexS
qqmPOgHtxJZb+GKHP1NFb6X7Ljh7Q2Zi+1ZE40M7ErJ+b2DhWXIYKrFQhl5ccTAK
J2CnnhcnB7GrIQOll8UqA1qfK0S/APwdYCaZLZ8l0/XDSB8ICnCmTOnYXFBekdro
CGUoGFM5b9EPoGv2DOIOrhhOcj+W1esDw5hwZo2KrhmvGM9us2Le7WBtH0H8g2gS
xgR5lEJ1NLeb7Zj4tOodZAul6dlRP/NR+H4hrY5fdeeEkbXUXiZ+5bzOptIWyqQ2
OrRnqbZvQivcZNGUyebSqDUbhm/WfB/F/xYMEvGRdMlNs6dFXziOOP1z2iDeUxrH
8IUsxx4RW8kouCTYT1KHGQk+xo5hSg0EUuSVOKp8XAUE70sPMJukW9FEsqpDMx03
1bHzw0vS83MiQEYBW8ePmz5976gU0vzBB/2uXnxW+sIsJB5oo8Nb4AodqJHBGsJj
r8upXf9RaOGOjf4J4YyEYkAi+qskzu4F8oIlRysL+8nNAJlVXLA=
=XZWe
-END PGP SIGNATURE-

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



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

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

Remy Maucherat  changed:

   What|Removed |Added

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

--- Comment #3 from Remy Maucherat  ---
The root cause was that the container state was not properly set to FAILED on a
JVM error exception class.
The fix will be in 9.0.28, 8.5.48 and 7.0.98.

-- 
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: 63765: Properly mark container as FAILED when a JVM error occurs on stop # Conflicts: # webapps/docs/changelog.xml

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

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 211006a  63765: Properly mark container as FAILED when a JVM error 
occurs on stop # Conflicts: #   webapps/docs/changelog.xml
211006a is described below

commit 211006a152cdbd6e594ef037caec6d409153889e
Author: remm 
AuthorDate: Fri Oct 11 18:12:53 2019 +0200

63765: Properly mark container as FAILED when a JVM error occurs on stop
# Conflicts:
#   webapps/docs/changelog.xml
---
 java/org/apache/catalina/util/LifecycleBase.java | 2 +-
 webapps/docs/changelog.xml   | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/util/LifecycleBase.java 
b/java/org/apache/catalina/util/LifecycleBase.java
index 4b9bc2a..c2ddf43 100644
--- a/java/org/apache/catalina/util/LifecycleBase.java
+++ b/java/org/apache/catalina/util/LifecycleBase.java
@@ -432,8 +432,8 @@ public abstract class LifecycleBase implements Lifecycle {
 
 
 private void handleSubClassException(Throwable t, String key, Object... 
args) throws LifecycleException {
-ExceptionUtils.handleThrowable(t);
 setStateInternal(LifecycleState.FAILED, null, false);
+ExceptionUtils.handleThrowable(t);
 String msg = sm.getString(key, args);
 if (getThrowOnFailure()) {
 if (!(t instanceof LifecycleException)) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 82b4cc0..f87315d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -60,6 +60,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+63765: Properly mark container as FAILED when a JVM error
+occurs on stop. (remm)
+  
+
+  
   
 
   


-
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: 63765: Properly mark container as FAILED when a JVM error occurs on stop # Conflicts: # webapps/docs/changelog.xml

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

remm 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 a7da104  63765: Properly mark container as FAILED when a JVM error 
occurs on stop # Conflicts: #   webapps/docs/changelog.xml
a7da104 is described below

commit a7da104b7e1e80e758807d463e4234dd57a64d85
Author: remm 
AuthorDate: Fri Oct 11 18:12:53 2019 +0200

63765: Properly mark container as FAILED when a JVM error occurs on stop
# Conflicts:
#   webapps/docs/changelog.xml
---
 java/org/apache/catalina/util/LifecycleBase.java | 2 +-
 webapps/docs/changelog.xml   | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/util/LifecycleBase.java 
b/java/org/apache/catalina/util/LifecycleBase.java
index 8ea4d65..870cb9a 100644
--- a/java/org/apache/catalina/util/LifecycleBase.java
+++ b/java/org/apache/catalina/util/LifecycleBase.java
@@ -432,8 +432,8 @@ public abstract class LifecycleBase implements Lifecycle {
 
 
 private void handleSubClassException(Throwable t, String key, Object... 
args) throws LifecycleException {
-ExceptionUtils.handleThrowable(t);
 setStateInternal(LifecycleState.FAILED, null, false);
+ExceptionUtils.handleThrowable(t);
 String msg = sm.getString(key, args);
 if (getThrowOnFailure()) {
 if (!(t instanceof LifecycleException)) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8ba4b26..ab69483 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -45,6 +45,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+63765: Properly mark container as FAILED when a JVM error
+occurs on stop. (remm)
+  
+
+  
   
 
   


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



[tomcat] branch master updated: 63765: Properly mark container as FAILED when a JVM error occurs on stop

2019-10-11 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 8e94406  63765: Properly mark container as FAILED when a JVM error 
occurs on stop
8e94406 is described below

commit 8e94406ba19e58cfa919889c215216cd6b4599bc
Author: remm 
AuthorDate: Fri Oct 11 18:12:53 2019 +0200

63765: Properly mark container as FAILED when a JVM error occurs on stop
---
 java/org/apache/catalina/util/LifecycleBase.java | 2 +-
 webapps/docs/changelog.xml   | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/util/LifecycleBase.java 
b/java/org/apache/catalina/util/LifecycleBase.java
index 8ea4d65..870cb9a 100644
--- a/java/org/apache/catalina/util/LifecycleBase.java
+++ b/java/org/apache/catalina/util/LifecycleBase.java
@@ -432,8 +432,8 @@ public abstract class LifecycleBase implements Lifecycle {
 
 
 private void handleSubClassException(Throwable t, String key, Object... 
args) throws LifecycleException {
-ExceptionUtils.handleThrowable(t);
 setStateInternal(LifecycleState.FAILED, null, false);
+ExceptionUtils.handleThrowable(t);
 String msg = sm.getString(key, args);
 if (getThrowOnFailure()) {
 if (!(t instanceof LifecycleException)) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 90b59b9..a860c45 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -51,6 +51,10 @@
 Bad paths for URIs can cause exceptions on Windows due to its
 path separator, so wrap using an IOException. (remm)
   
+  
+63765: Properly mark container as FAILED when a JVM error
+occurs on stop. (remm)
+  
 
   
   


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



[Bug 63835] Add support for Keep-Alive header

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

--- Comment #5 from Mark Thomas  ---
The proposal never went past draft 03 in 2012. I'm wondering why.

The max parameter is already deprecated in draft 03. I don't think Tomcat
should be implementing a deprecated feature of a draft proposal without a very
good reason and I can't see one at this point.

I can see the timeout could be useful in avoiding sending a request just as the
server was closing the connection, triggering a TCP reset and a need to resend
the request. However, for that to work the client needs a reasonable estimate
of the latency between the client and the server and that isn't always
available.

That it is intended to send this header only when the client sends "Connection:
keep-alive" doesn't really change things. Browsers usually send that. Having to
parse the request header and likely generate the response header adds overhead
to every request. It would be useful to have a sense of the scale of that
overhead.

-- 
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: [VOTE] Private branches in the official Tomcat git repository

2019-10-11 Thread Emmanuel Bourg
Le 11/10/2019 à 16:20, Rémy Maucherat a écrit :

> Should private branches be allowed in the official Tomcat git repository ?
> [X] Yes
> [ ] No

+1

Emmanuel Bourg

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



[Bug 63814] Socket timeout -1 no longer allowed since Java 13, leading to IllegalArgumentException and unit test hang for TestAbstractAjpProcessor

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

Remy Maucherat  changed:

   What|Removed |Added

 CC||knst.koli...@gmail.com

--- Comment #3 from Remy Maucherat  ---
*** Bug 63837 has been marked as a duplicate of this bug. ***

-- 
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 63837] 7.0.97: TestAbstractAjpProcessor hangs when run with Java 13.0 and NIO.

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

Remy Maucherat  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from Remy Maucherat  ---
Rainer had reported it before.

*** This bug has been marked as a duplicate of bug 63814 ***

-- 
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: [VOTE] Private branches in the official Tomcat git repository

2019-10-11 Thread guo xiong li
> Hi,
>
> This vote is to regulate the use of branches in the official Tomcat
> repository beyond branches that are approved by the community such as
8.5.x
> and 7.0.x. It is possible to do development in private branches directly
in
> the official Tomcat repository, as an alternative to using forks and pull
> requests.
>
> Should private branches be allowed in the official Tomcat git repository ?
> [ ] Yes
>  [X] No

In my opinion, I think the branches in Tomcat repo should correspond to the
current major maintenance version. Because this can be easily managed.
Some middle jobs when solving bug and adding feature should be done in
private fork.
I consider that the branch in Tomcat repo should be created by *project
committer* after a vote and can't be created by anybody casually.

On Fri, Oct 11, 2019 at 10:21 PM Rémy Maucherat  wrote:

> Hi,
>
> This vote is to regulate the use of branches in the official Tomcat
> repository beyond branches that are approved by the community such as 8.5.x
> and 7.0.x. It is possible to do development in private branches directly in
> the official Tomcat repository, as an alternative to using forks and pull
> requests.
>
> Should private branches be allowed in the official Tomcat git repository ?
> [ ] Yes
> [ ] No
>
> Rémy
>


Re: Possible bug in Http11Processor/SocketWrapperBase

2019-10-11 Thread Mark Thomas
On 11/10/2019 13:21, Michael Osipov wrote:
> Folks,
> 
> while working on BZ-63835 I have noticed an odd thing and I'd like
> someone to review whether my code/understanding is wrong or the one
> already present in Tomcat.



> we have a total of 100 requests (HTTP/1.1 302).

That is consistent with the docs that state there will be
maxKeepAliveRequests before the connection is closed.

> I'd assume the
> connection to sustain 100 requests and on the n+1 requests to be closed.

That assumption is not consistent with the documentation (which has been
the same for as long as I can remember).

> The expired header proposal says:
>>    The value of the "max" parameter counts the number of requests since
>>    the connection was created.

The same proposal also states that the use of the max parameter is
deprecated.

Mark


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



Re: [VOTE] Private branches in the official Tomcat git repository

2019-10-11 Thread Rémy Maucherat
On Fri, Oct 11, 2019 at 4:30 PM Michael Osipov  wrote:

> Am 2019-10-11 um 16:20 schrieb Rémy Maucherat:
> > Hi,
> >
> > This vote is to regulate the use of branches in the official Tomcat
> > repository beyond branches that are approved by the community such as
> 8.5.x
> > and 7.0.x. It is possible to do development in private branches directly
> in
> > the official Tomcat repository, as an alternative to using forks and pull
> > requests.
> >
> > Should private branches be allowed in the official Tomcat git repository
> ?
> > [ ] Yes
> > [ ] No
>
> I don't like the term 'private' because everytihing I add to the
> canonical repo is intended to merged into upstream sooner or later.
> Purely private stuff must be in a fork anyway.
>
> Please redefine.
>

Well, it's already in the text of the vote ("This vote is to regulate the
use of branches in the official Tomcat repository beyond branches that are
approved by the community such as 8.5.x and 7.0.x"): Private branches are
defined here as any branches whose creation is not approved and voted on by
the community.

= I feel like creating branch "remm", is it allowed ?
So I say no, because this is the Tomcat repo, not remm's repo, even though
commits could possibly be interesting this is a bit too much.

Rémy


>
> In that case as depicted by me:
> Yes!
>
>


Re: [VOTE] Private branches in the official Tomcat git repository

2019-10-11 Thread Rémy Maucherat
On Fri, Oct 11, 2019 at 4:20 PM Rémy Maucherat  wrote:

> Hi,
>
> This vote is to regulate the use of branches in the official Tomcat
> repository beyond branches that are approved by the community such as 8.5.x
> and 7.0.x. It is possible to do development in private branches directly in
> the official Tomcat repository, as an alternative to using forks and pull
> requests.
>
> Should private branches be allowed in the official Tomcat git repository ?
> [ ] Yes
> [X] No
>
> I found branches created a disproportionate amount of email traffic which
is rather distracting and not necessarily easy to visually separate from
"real" commits on official branches, in addition to requiring subsequent
cleanup and maintenance causing further email traffic nuisance. As a
result, I believe any early/experimental development work should rather
happen in separate git forks and pull requests.

Rémy


Re: [VOTE] Private branches in the official Tomcat git repository

2019-10-11 Thread Michael Osipov

Am 2019-10-11 um 16:20 schrieb Rémy Maucherat:

Hi,

This vote is to regulate the use of branches in the official Tomcat
repository beyond branches that are approved by the community such as 8.5.x
and 7.0.x. It is possible to do development in private branches directly in
the official Tomcat repository, as an alternative to using forks and pull
requests.

Should private branches be allowed in the official Tomcat git repository ?
[ ] Yes
[ ] No


I don't like the term 'private' because everytihing I add to the 
canonical repo is intended to merged into upstream sooner or later. 
Purely private stuff must be in a fork anyway.


Please redefine.

In that case as depicted by me:
Yes!


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



[VOTE] Private branches in the official Tomcat git repository

2019-10-11 Thread Rémy Maucherat
Hi,

This vote is to regulate the use of branches in the official Tomcat
repository beyond branches that are approved by the community such as 8.5.x
and 7.0.x. It is possible to do development in private branches directly in
the official Tomcat repository, as an alternative to using forks and pull
requests.

Should private branches be allowed in the official Tomcat git repository ?
[ ] Yes
[ ] No

Rémy


Re: [tomcat] branch BZ-63835/8.5.x created (now 6ff2233)

2019-10-11 Thread Michael Osipov

Am 2019-10-11 um 16:07 schrieb Rémy Maucherat:

On Fri, Oct 11, 2019 at 3:46 PM Michael Osipov  wrote:


Am 2019-10-11 um 15:10 schrieb Rémy Maucherat:

On Fri, Oct 11, 2019 at 1:51 PM Michael Osipov 

wrote:



Am 2019-10-11 um 11:32 schrieb Rémy Maucherat:

On Fri, Oct 11, 2019 at 10:43 AM Mark Thomas  wrote:


On 11/10/2019 09:30, micha...@apache.org wrote:

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch BZ-63835/8.5.x


New features should be implemented against master and then back-ported
(assuming the community accepts them).



I also (still) prefer either PRs (it allows comments) or in master.


This is a first draft, nothing PR worthy. As soon as I see the code
working, I will create the PR by then and when approved in general I
will add tests and re-request review. So please be patient.



For this use I'd recommend using your own forked repository then. Using a
branch for that doesn't work for me, it sends way too many emails that

are

not actually useful to dev to the dev mailing list. I tried for a while,

it

didn't work, sorry :(


I am not really convinced by this and I will tell you why:

* Other TLPs have a commits@ for this
* The purpose of branches is exactly to work on something
* Having it in a fork would take the ability away that people instantly
notice my intermediate changes in a canonical location and leave
valuable comments as you did guys. No one will look at my fork as long
as I don't request it. I rather fix an issue early than two weeks later
in the PR.



I disagree with this so I will draft and hold a formal vote on this to
clarify the rules regarding the use of private branches.


Sounds reasonable.


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



Re: [tomcat] branch BZ-63835/8.5.x created (now 6ff2233)

2019-10-11 Thread Rémy Maucherat
On Fri, Oct 11, 2019 at 3:46 PM Michael Osipov  wrote:

> Am 2019-10-11 um 15:10 schrieb Rémy Maucherat:
> > On Fri, Oct 11, 2019 at 1:51 PM Michael Osipov 
> wrote:
> >
> >> Am 2019-10-11 um 11:32 schrieb Rémy Maucherat:
> >>> On Fri, Oct 11, 2019 at 10:43 AM Mark Thomas  wrote:
> >>>
>  On 11/10/2019 09:30, micha...@apache.org wrote:
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > michaelo pushed a change to branch BZ-63835/8.5.x
> 
>  New features should be implemented against master and then back-ported
>  (assuming the community accepts them).
> 
> >>>
> >>> I also (still) prefer either PRs (it allows comments) or in master.
> >>
> >> This is a first draft, nothing PR worthy. As soon as I see the code
> >> working, I will create the PR by then and when approved in general I
> >> will add tests and re-request review. So please be patient.
> >>
> >
> > For this use I'd recommend using your own forked repository then. Using a
> > branch for that doesn't work for me, it sends way too many emails that
> are
> > not actually useful to dev to the dev mailing list. I tried for a while,
> it
> > didn't work, sorry :(
>
> I am not really convinced by this and I will tell you why:
>
> * Other TLPs have a commits@ for this
> * The purpose of branches is exactly to work on something
> * Having it in a fork would take the ability away that people instantly
> notice my intermediate changes in a canonical location and leave
> valuable comments as you did guys. No one will look at my fork as long
> as I don't request it. I rather fix an issue early than two weeks later
> in the PR.
>

I disagree with this so I will draft and hold a formal vote on this to
clarify the rules regarding the use of private branches.

Rémy


Re: [tomcat] branch BZ-63835/8.5.x created (now 6ff2233)

2019-10-11 Thread Michael Osipov

Am 2019-10-11 um 15:20 schrieb Mark Thomas:

On 11/10/2019 14:10, Rémy Maucherat wrote:

On Fri, Oct 11, 2019 at 1:51 PM Michael Osipov mailto:micha...@apache.org>> wrote:

 Am 2019-10-11 um 11:32 schrieb Rémy Maucherat:
 > On Fri, Oct 11, 2019 at 10:43 AM Mark Thomas mailto:ma...@apache.org>> wrote:
 >
 >> On 11/10/2019 09:30, micha...@apache.org
  wrote:
 >>> This is an automated email from the ASF dual-hosted git repository.
 >>>
 >>> michaelo pushed a change to branch BZ-63835/8.5.x
 >>
 >> New features should be implemented against master and then
 back-ported
 >> (assuming the community accepts them).
 >>
 >
 > I also (still) prefer either PRs (it allows comments) or in master.

 This is a first draft, nothing PR worthy. As soon as I see the code
 working, I will create the PR by then and when approved in general I
 will add tests and re-request review. So please be patient.


For this use I'd recommend using your own forked repository then. Using
a branch for that doesn't work for me, it sends way too many emails that
are not actually useful to dev to the dev mailing list. I tried for a
while, it didn't work, sorry :(


I use upstream so much I should probably reconfigure the names of the
remotes in my checkout:
origin -> fork
upstream -> origin


This doesn't feel right. Origin always denotes the repo you cloned from, 
your fork. So keeping origin and upstream seems fine. I call upstream 
simply 'apache' in my forked ones and point to gitbox.apache.org.


Michael


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



Re: [tomcat] branch BZ-63835/8.5.x created (now 6ff2233)

2019-10-11 Thread Michael Osipov

Am 2019-10-11 um 15:10 schrieb Rémy Maucherat:

On Fri, Oct 11, 2019 at 1:51 PM Michael Osipov  wrote:


Am 2019-10-11 um 11:32 schrieb Rémy Maucherat:

On Fri, Oct 11, 2019 at 10:43 AM Mark Thomas  wrote:


On 11/10/2019 09:30, micha...@apache.org wrote:

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch BZ-63835/8.5.x


New features should be implemented against master and then back-ported
(assuming the community accepts them).



I also (still) prefer either PRs (it allows comments) or in master.


This is a first draft, nothing PR worthy. As soon as I see the code
working, I will create the PR by then and when approved in general I
will add tests and re-request review. So please be patient.



For this use I'd recommend using your own forked repository then. Using a
branch for that doesn't work for me, it sends way too many emails that are
not actually useful to dev to the dev mailing list. I tried for a while, it
didn't work, sorry :(


I am not really convinced by this and I will tell you why:

* Other TLPs have a commits@ for this
* The purpose of branches is exactly to work on something
* Having it in a fork would take the ability away that people instantly 
notice my intermediate changes in a canonical location and leave 
valuable comments as you did guys. No one will look at my fork as long 
as I don't request it. I rather fix an issue early than two weeks later 
in the PR.



-
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: asyncStarted should be false once complete/dispatch in onError

2019-10-11 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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 758e909  asyncStarted should be false once complete/dispatch in onError
758e909 is described below

commit 758e909cb931b753b36afb1bfcc193a0699e9a43
Author: Mark Thomas 
AuthorDate: Fri Oct 11 14:25:17 2019 +0100

asyncStarted should be false once complete/dispatch in onError
---
 java/org/apache/coyote/AsyncStateMachine.java  | 25 
 .../apache/catalina/core/TestAsyncContextImpl.java | 35 +++---
 webapps/docs/changelog.xml |  3 +-
 3 files changed, 39 insertions(+), 24 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index 8e2d8db..07f9b5c 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -274,7 +274,7 @@ public class AsyncStateMachine {
 
 private synchronized boolean doComplete() {
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_COMPLETE;
@@ -287,10 +287,11 @@ public class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.TIMING_OUT) {
-// Processing of timeouts can happen on or off a container thread
-// (on is much more likely) but while in this state the call that
-// triggers the timeout will be in progress on a container thread.
+} else if (state == AsyncState.TIMING_OUT || state == 
AsyncState.ERROR) {
+// Processing of timeouts and errors can happen on or off a
+// container thread (on is much more likely) but while in this 
state
+// the call that triggers the timeout will be in progress on a
+// container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
@@ -334,7 +335,7 @@ public class AsyncStateMachine {
 
 private synchronized boolean doDispatch() {
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_DISPATCH;
@@ -347,13 +348,11 @@ public class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.TIMING_OUT) {
-// Read/write operations can happen on or off a container thread 
but
-// while in this state the call to listener that triggers the
-// read/write will be in progress on a container thread.
-// Processing of timeouts can happen on or off a container thread
-// (on is much more likely) but while in this state the call that
-// triggers the timeout will be in progress on a container thread.
+} else if (state == AsyncState.TIMING_OUT || state == 
AsyncState.ERROR) {
+// Processing of timeouts and errors can happen on or off a
+// container thread (on is much more likely) but while in this 
state
+// the call that triggers the timeout will be in progress on a
+// container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 2319ca7..461b1e1 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -679,6 +679,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
 count ++;
 }
 Assert.assertEquals(expectedTrack, getTrack());
+Assert.assertTrue(dispatch.isAsyncStartedCorrect());
 
 // Check the access log
 alv.validateAccessLog(1, 

[tomcat] branch 8.5.x updated: asyncStarted should be false once complete/dispatch in onError

2019-10-11 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 476c7f7  asyncStarted should be false once complete/dispatch in onError
476c7f7 is described below

commit 476c7f755b4494f2e1fedfdae637be29fd86da1d
Author: Mark Thomas 
AuthorDate: Fri Oct 11 14:25:17 2019 +0100

asyncStarted should be false once complete/dispatch in onError
---
 java/org/apache/coyote/AsyncStateMachine.java  | 24 ---
 .../apache/catalina/core/TestAsyncContextImpl.java | 35 +++---
 webapps/docs/changelog.xml |  3 +-
 3 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index 0d364f4..cd98f38 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -321,7 +321,7 @@ public class AsyncStateMachine {
 private synchronized boolean doComplete() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_COMPLETE;
@@ -334,13 +334,15 @@ public class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT) {
+} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT ||
+state == AsyncState.ERROR) {
 // Read/write operations can happen on or off a container thread 
but
 // while in this state the call to listener that triggers the
 // read/write will be in progress on a container thread.
-// Processing of timeouts can happen on or off a container thread
-// (on is much more likely) but while in this state the call that
-// triggers the timeout will be in progress on a container thread.
+// Processing of timeouts and errors can happen on or off a
+// container thread (on is much more likely) but while in this 
state
+// the call that triggers the timeout will be in progress on a
+// container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
@@ -385,7 +387,7 @@ public class AsyncStateMachine {
 private synchronized boolean doDispatch() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_DISPATCH;
@@ -398,13 +400,15 @@ public class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT) {
+} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT ||
+state == AsyncState.ERROR) {
 // Read/write operations can happen on or off a container thread 
but
 // while in this state the call to listener that triggers the
 // read/write will be in progress on a container thread.
-// Processing of timeouts can happen on or off a container thread
-// (on is much more likely) but while in this state the call that
-// triggers the timeout will be in progress on a container thread.
+// Processing of timeouts and errors can happen on or off a
+// container thread (on is much more likely) but while in this 
state
+// the call that triggers the timeout will be in progress on a
+// container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 

[tomcat] branch master updated: asyncStarted should be false once complete/dispatch in onError

2019-10-11 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 02b865c  asyncStarted should be false once complete/dispatch in onError
02b865c is described below

commit 02b865c9a1662ae7f819333d3a7d06c29e97bea9
Author: Mark Thomas 
AuthorDate: Fri Oct 11 14:25:17 2019 +0100

asyncStarted should be false once complete/dispatch in onError
---
 java/org/apache/coyote/AsyncStateMachine.java  | 24 ---
 .../apache/catalina/core/TestAsyncContextImpl.java | 35 +++---
 webapps/docs/changelog.xml |  3 +-
 3 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index 33cbff4..5fe1ecc 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -321,7 +321,7 @@ class AsyncStateMachine {
 private synchronized boolean doComplete() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_COMPLETE;
@@ -334,13 +334,15 @@ class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT) {
+} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT ||
+state == AsyncState.ERROR) {
 // Read/write operations can happen on or off a container thread 
but
 // while in this state the call to listener that triggers the
 // read/write will be in progress on a container thread.
-// Processing of timeouts can happen on or off a container thread
-// (on is much more likely) but while in this state the call that
-// triggers the timeout will be in progress on a container thread.
+// Processing of timeouts and errors can happen on or off a
+// container thread (on is much more likely) but while in this 
state
+// the call that triggers the timeout will be in progress on a
+// container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
@@ -385,7 +387,7 @@ class AsyncStateMachine {
 private synchronized boolean doDispatch() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_DISPATCH;
@@ -398,13 +400,15 @@ class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT) {
+} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT ||
+state == AsyncState.ERROR) {
 // Read/write operations can happen on or off a container thread 
but
 // while in this state the call to listener that triggers the
 // read/write will be in progress on a container thread.
-// Processing of timeouts can happen on or off a container thread
-// (on is much more likely) but while in this state the call that
-// triggers the timeout will be in progress on a container thread.
+// Processing of timeouts and errors can happen on or off a
+// container thread (on is much more likely) but while in this 
state
+// the call that triggers the timeout will be in progress on a
+// container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java

Re: [tomcat] branch BZ-63835/8.5.x created (now 6ff2233)

2019-10-11 Thread Mark Thomas
On 11/10/2019 14:10, Rémy Maucherat wrote:
> On Fri, Oct 11, 2019 at 1:51 PM Michael Osipov  > wrote:
> 
> Am 2019-10-11 um 11:32 schrieb Rémy Maucherat:
> > On Fri, Oct 11, 2019 at 10:43 AM Mark Thomas  > wrote:
> >
> >> On 11/10/2019 09:30, micha...@apache.org
>  wrote:
> >>> This is an automated email from the ASF dual-hosted git repository.
> >>>
> >>> michaelo pushed a change to branch BZ-63835/8.5.x
> >>
> >> New features should be implemented against master and then
> back-ported
> >> (assuming the community accepts them).
> >>
> >
> > I also (still) prefer either PRs (it allows comments) or in master.
> 
> This is a first draft, nothing PR worthy. As soon as I see the code
> working, I will create the PR by then and when approved in general I
> will add tests and re-request review. So please be patient.
> 
> 
> For this use I'd recommend using your own forked repository then. Using
> a branch for that doesn't work for me, it sends way too many emails that
> are not actually useful to dev to the dev mailing list. I tried for a
> while, it didn't work, sorry :(
> 
> So either:
> - a PR
> - directly in master

master is fine when you are fairly sure the code is right. It isn't the
place for experiments since we release 9.0.x off master.

> - your git fork

I use the fork approach.

I have a local checkout of my fork with the apache/tomcat github mirror
configured as an additional remote called "upstream".

Most of the time I work on upstream but occasionally, I'll push
something to the fork and generate a PR to obtain feedback.

I also use the fork if I need to share in-progress work between my
desktop and laptop.

I use upstream so much I should probably reconfigure the names of the
remotes in my checkout:
origin -> fork
upstream -> origin

Mark

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



Re: [VOTE] Release Apache Tomcat 7.0.97

2019-10-11 Thread guo xiong li
The BZ-63833 describes a NullPointerException in branch 7.0.x.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63833

It is better to solve it before release. I submit a patch to solve it just
now. Hope it  can help.

On Fri, Oct 11, 2019 at 9:04 PM Konstantin Kolinko 
wrote:

> вс, 6 окт. 2019 г. в 13:01, Violeta Georgieva :
> >
> > The proposed Apache Tomcat 7.0.97 release is now available for voting.
> >
>
> Thus far I ran the unit tests on Windows 10 with Java 6, 7, 8 and 13
> for all connectors.
> All is good except the following:
>
> 1. TestWebdavServletOptions fails with OutOfMemoryError on 32-bit Java
> and NIO connector (Java 6, 7, 8).
>
> It is not a regression and I do not consider it a showstopper.
>
> Filed into Bugzilla:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=63836
>
> 2.TestAbstractAjpProcessor hangs with Java 13 and NIO.
>
> It would be better to fix this, if possible.
> It is also possible to release with this issue, but add a note to an
> announcement. I think that there exist a workaround by explicitly
> setting a timeout in server.xml.
>
> Filed into Bugzilla:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=63837
>
>
> 3. An Illegal reflective access warning for WebappClassLoaderBase with
> Java 13.
>
> Just a warning. I filed it as an enhancement request:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=63838
>
> Best regards,
> Konstantin Kolinko
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


[Bug 63833] NPE in DBCP when attempting to connect to a database that doesn't exist

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

--- Comment #1 from Guoxiong Li  ---
Created attachment 36823
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36823=edit
A draft to solve this issue.

-- 
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: [tomcat] branch BZ-63835/8.5.x created (now 6ff2233)

2019-10-11 Thread Rémy Maucherat
On Fri, Oct 11, 2019 at 1:51 PM Michael Osipov  wrote:

> Am 2019-10-11 um 11:32 schrieb Rémy Maucherat:
> > On Fri, Oct 11, 2019 at 10:43 AM Mark Thomas  wrote:
> >
> >> On 11/10/2019 09:30, micha...@apache.org wrote:
> >>> This is an automated email from the ASF dual-hosted git repository.
> >>>
> >>> michaelo pushed a change to branch BZ-63835/8.5.x
> >>
> >> New features should be implemented against master and then back-ported
> >> (assuming the community accepts them).
> >>
> >
> > I also (still) prefer either PRs (it allows comments) or in master.
>
> This is a first draft, nothing PR worthy. As soon as I see the code
> working, I will create the PR by then and when approved in general I
> will add tests and re-request review. So please be patient.
>

For this use I'd recommend using your own forked repository then. Using a
branch for that doesn't work for me, it sends way too many emails that are
not actually useful to dev to the dev mailing list. I tried for a while, it
didn't work, sorry :(

So either:
- a PR
- directly in master
- your git fork

Rémy


Re: [VOTE] Release Apache Tomcat 7.0.97

2019-10-11 Thread Konstantin Kolinko
вс, 6 окт. 2019 г. в 13:01, Violeta Georgieva :
>
> The proposed Apache Tomcat 7.0.97 release is now available for voting.
>

Thus far I ran the unit tests on Windows 10 with Java 6, 7, 8 and 13
for all connectors.
All is good except the following:

1. TestWebdavServletOptions fails with OutOfMemoryError on 32-bit Java
and NIO connector (Java 6, 7, 8).

It is not a regression and I do not consider it a showstopper.

Filed into Bugzilla:
https://bz.apache.org/bugzilla/show_bug.cgi?id=63836

2.TestAbstractAjpProcessor hangs with Java 13 and NIO.

It would be better to fix this, if possible.
It is also possible to release with this issue, but add a note to an
announcement. I think that there exist a workaround by explicitly
setting a timeout in server.xml.

Filed into Bugzilla:
https://bz.apache.org/bugzilla/show_bug.cgi?id=63837


3. An Illegal reflective access warning for WebappClassLoaderBase with Java 13.

Just a warning. I filed it as an enhancement request:
https://bz.apache.org/bugzilla/show_bug.cgi?id=63838

Best regards,
Konstantin Kolinko

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



Re: [tomcat] 01/01: First draft

2019-10-11 Thread Michael Osipov

Am 2019-10-11 um 14:35 schrieb Rémy Maucherat:

On Fri, Oct 11, 2019 at 1:49 PM Michael Osipov  wrote:


Am 2019-10-11 um 11:51 schrieb Rémy Maucherat:

On Fri, Oct 11, 2019 at 10:30 AM  wrote:


This is an automated email from the ASF dual-hosted git repository.

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

commit 6ff2233cbbd27c9c2c649208a21931e5f3e132a6
Author: Michael Osipov 
AuthorDate: Fri Oct 11 10:30:08 2019 +0200

  First draft



+if (keepAliveTimeout > 0) {
+String value = "timeout=" +
TimeUnit.MILLISECONDS.toSeconds(keepAliveTimeout);
+
+if (maxKeepAliveRequests > 0) {
+value += ", max=" + maxKeepAliveRequests;
+}
StringBuilder ?


StringBuilder does not make any sense because:

* The compiler will replace the static code automatically with a
StringBuilder
* StringBuilder gains benefit when you concat strings in a for/while/do
loop. The above code is purely static.



I don't understand how this can work, or how it is static, but if you're
100% certain it's fine.


Please look here: 
https://dzone.com/articles/string-concatenation-performacne-improvement-in-ja


Exactly the same case.


Can you add a new flag controlling the feature ? The information may not

be

very useful in many cases such as when proxying, so it would be better to
skip generating it by default.


This is -- as documented -- a first draft.

As mentioned on the ticket. This is hop-by-hop and writetn only if the
client requests this piece of information. We can surely discuss a flag
for this on the connector.



Ok indeed. I never understood why some clients kept sending Connection:
keep-alive since it was also not needed.


To be honest, I didn't know either until I started digging for the 
client problem a colleague had.


Try against HTTPd and you'll see even with HTTP 1.1 client.


Michael


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



[Bug 63838] Illegal reflective access by WebappClassLoaderBase$1 in Java 13

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

Konstantin Kolinko  changed:

   What|Removed |Added

 OS||All

--- Comment #1 from Konstantin Kolinko  ---
I do not see the warnings when I start Tomcat normally with catalina.bat.

-- 
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 63837] 7.0.97: TestAbstractAjpProcessor hangs when run with Java 13.0 and NIO.

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

Konstantin Kolinko  changed:

   What|Removed |Added

 OS||All

--- Comment #3 from Konstantin Kolinko  ---
To reproduce the issue for smoke testing, the AJP connector must be explicitly
configured to use the Nio implementation with

protocol="org.apache.coyote.ajp.AjpNioProtocol"

It is not the default implementation of the connector in Tomcat 7.

-- 
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: asyncStarted should be false once complete/dispatch in onTimeout

2019-10-11 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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 528032c  asyncStarted should be false once complete/dispatch in 
onTimeout
528032c is described below

commit 528032c68cb711287eb437069cceb005f8ba32b6
Author: Mark Thomas 
AuthorDate: Thu Oct 10 16:57:55 2019 +0100

asyncStarted should be false once complete/dispatch in onTimeout
---
 java/org/apache/coyote/AsyncStateMachine.java  | 25 +++---
 .../apache/catalina/core/TestAsyncContextImpl.java | 38 +++---
 webapps/docs/changelog.xml |  6 
 3 files changed, 61 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index 0c1bcec..8e2d8db 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -274,8 +274,7 @@ public class AsyncStateMachine {
 
 private synchronized boolean doComplete() {
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
-state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_COMPLETE;
@@ -288,6 +287,14 @@ public class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
+} else if (state == AsyncState.TIMING_OUT) {
+// Processing of timeouts can happen on or off a container thread
+// (on is much more likely) but while in this state the call that
+// triggers the timeout will be in progress on a container thread.
+// The socket will be added to the poller when the container thread
+// exits the AbstractConnectionHandler.process() method so don't do
+// a dispatch here which would add it to the poller a second time.
+state = AsyncState.COMPLETING;
 } else {
 throw new IllegalStateException(
 sm.getString("asyncStateMachine.invalidAsyncState",
@@ -327,8 +334,7 @@ public class AsyncStateMachine {
 
 private synchronized boolean doDispatch() {
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
-state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_DISPATCH;
@@ -341,6 +347,17 @@ public class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
+} else if (state == AsyncState.TIMING_OUT) {
+// Read/write operations can happen on or off a container thread 
but
+// while in this state the call to listener that triggers the
+// read/write will be in progress on a container thread.
+// Processing of timeouts can happen on or off a container thread
+// (on is much more likely) but while in this state the call that
+// triggers the timeout will be in progress on a container thread.
+// The socket will be added to the poller when the container thread
+// exits the AbstractConnectionHandler.process() method so don't do
+// a dispatch here which would add it to the poller a second time.
+state = AsyncState.DISPATCHING;
 } else {
 throw new IllegalStateException(
 sm.getString("asyncStateMachine.invalidAsyncState",
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index a8cb064..2319ca7 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -552,19 +552,25 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
 alv.validateAccessLog(1, 200, timeoutDelay,
 timeoutDelay + TIMEOUT_MARGIN + REQUEST_TIME);
 }
+
+Assert.assertTrue(timeout.isAsyncStartedCorrect());
 }
 
 private static class TimeoutServlet extends HttpServlet {
 private static final long serialVersionUID = 1L;
 
 private final Boolean completeOnTimeout;
-private 

[Bug 63838] New: Illegal reflective access by WebappClassLoaderBase$1 in Java 13

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

Bug ID: 63838
   Summary: Illegal reflective access by WebappClassLoaderBase$1
in Java 13
   Product: Tomcat 7
   Version: trunk
  Hardware: PC
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: knst.koli...@gmail.com
  Target Milestone: ---

Testing a release candidate for 7.0.97:

When I run it with Java 13 (13u0 64-bit from Oracle, running on Windows 10) I
see the following messages in the output of Apache Ant:

> [junit] WARNING: An illegal reflective access operation has occurred
> [junit] WARNING: Illegal reflective access by 
> org.apache.catalina.loader.WebappClassLoaderBase$1 
> (file:/D:/workspace/temp/temp.2019-10-10_tc7097/apache-tomcat-7.0.97-src/output/classes/)
>  to method java.lang.ClassLoader.registerAsParallelCapable()
> [junit] WARNING: Please consider reporting this to the maintainers of 
> org.apache.catalina.loader.WebappClassLoaderBase$1
> [junit] WARNING: Use --illegal-access=warn to enable warnings of further 
> illegal reflective access operations
> [junit] WARNING: All illegal access operations will be denied in a future 
> release

See bug 63837 and ant_test.log attached to it for the details and the full log
output.
https://bz.apache.org/bugzilla/attachment.cgi?id=36821

I am marking this issue as an enhancement. It as warning and not a showstopper.

-- 
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 8.5.x updated: asyncStarted should be false once complete/dispatch in onTimeout

2019-10-11 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 d91f848  asyncStarted should be false once complete/dispatch in 
onTimeout
d91f848 is described below

commit d91f848dbb9b20b2649db918af901c841b796ed8
Author: Mark Thomas 
AuthorDate: Thu Oct 10 16:57:55 2019 +0100

asyncStarted should be false once complete/dispatch in onTimeout
---
 java/org/apache/coyote/AsyncStateMachine.java  | 16 +
 .../apache/catalina/core/TestAsyncContextImpl.java | 38 +++---
 webapps/docs/changelog.xml | 10 ++
 3 files changed, 54 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index 2c2c582..0d364f4 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -321,8 +321,7 @@ public class AsyncStateMachine {
 private synchronized boolean doComplete() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
-state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_COMPLETE;
@@ -335,10 +334,13 @@ public class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.READ_WRITE_OP) {
+} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT) {
 // Read/write operations can happen on or off a container thread 
but
 // while in this state the call to listener that triggers the
 // read/write will be in progress on a container thread.
+// Processing of timeouts can happen on or off a container thread
+// (on is much more likely) but while in this state the call that
+// triggers the timeout will be in progress on a container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
@@ -383,8 +385,7 @@ public class AsyncStateMachine {
 private synchronized boolean doDispatch() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
-state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_DISPATCH;
@@ -397,10 +398,13 @@ public class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.READ_WRITE_OP) {
+} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT) {
 // Read/write operations can happen on or off a container thread 
but
 // while in this state the call to listener that triggers the
 // read/write will be in progress on a container thread.
+// Processing of timeouts can happen on or off a container thread
+// (on is much more likely) but while in this state the call that
+// triggers the timeout will be in progress on a container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 32bad39..6e01bbe 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -555,19 +555,25 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
 alv.validateAccessLog(1, 200, timeoutDelay,
 timeoutDelay + TIMEOUT_MARGIN + REQUEST_TIME);
 }
+
+Assert.assertTrue(timeout.isAsyncStartedCorrect());
 }
 
 private static class TimeoutServlet extends HttpServlet {

[tomcat] branch master updated: asyncStarted should be false once complete/dispatch in onTimeout

2019-10-11 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 71389c0  asyncStarted should be false once complete/dispatch in 
onTimeout
71389c0 is described below

commit 71389c058286e70f88235c92283ed0fa45a2b027
Author: Mark Thomas 
AuthorDate: Thu Oct 10 16:57:55 2019 +0100

asyncStarted should be false once complete/dispatch in onTimeout
---
 java/org/apache/coyote/AsyncStateMachine.java  | 16 +
 .../apache/catalina/core/TestAsyncContextImpl.java | 38 +++---
 webapps/docs/changelog.xml | 10 ++
 3 files changed, 54 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index 6d66567..33cbff4 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -321,8 +321,7 @@ class AsyncStateMachine {
 private synchronized boolean doComplete() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
-state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_COMPLETE;
@@ -335,10 +334,13 @@ class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.READ_WRITE_OP) {
+} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT) {
 // Read/write operations can happen on or off a container thread 
but
 // while in this state the call to listener that triggers the
 // read/write will be in progress on a container thread.
+// Processing of timeouts can happen on or off a container thread
+// (on is much more likely) but while in this state the call that
+// triggers the timeout will be in progress on a container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
@@ -383,8 +385,7 @@ class AsyncStateMachine {
 private synchronized boolean doDispatch() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
-state == AsyncState.ERROR) {
+if (state == AsyncState.STARTING || state == AsyncState.ERROR) {
 // Processing is on a container thread so no need to transfer
 // processing to a new container thread
 state = AsyncState.MUST_DISPATCH;
@@ -397,10 +398,13 @@ class AsyncStateMachine {
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
 triggerDispatch = true;
-} else if (state == AsyncState.READ_WRITE_OP) {
+} else if (state == AsyncState.READ_WRITE_OP || state == 
AsyncState.TIMING_OUT) {
 // Read/write operations can happen on or off a container thread 
but
 // while in this state the call to listener that triggers the
 // read/write will be in progress on a container thread.
+// Processing of timeouts can happen on or off a container thread
+// (on is much more likely) but while in this state the call that
+// triggers the timeout will be in progress on a container thread.
 // The socket will be added to the poller when the container thread
 // exits the AbstractConnectionHandler.process() method so don't do
 // a dispatch here which would add it to the poller a second time.
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index d748086..3d496f4 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -555,19 +555,25 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
 alv.validateAccessLog(1, 200, timeoutDelay,
 timeoutDelay + TIMEOUT_MARGIN + REQUEST_TIME);
 }
+
+Assert.assertTrue(timeout.isAsyncStartedCorrect());
 }
 
 private static class TimeoutServlet extends HttpServlet {
 private static 

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

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

--- Comment #2 from Remy Maucherat  ---
After testing, the InlineExecutorService does the part properly using a
FutureTask, so nothing to fix here.

Problems are:
- ContainerBase.stopInternal throws a LifecycleException on any failure
- If working around that, StandardContext.stopInternal remains in STOPPING
state which causes further LifecycleException

Not sure yet what the best strategy is, probably avoid the first item, and be
more robust about the end state in case of a StandardContext.stopInternal
error.

-- 
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: [tomcat] 01/01: First draft

2019-10-11 Thread Rémy Maucherat
On Fri, Oct 11, 2019 at 1:49 PM Michael Osipov  wrote:

> Am 2019-10-11 um 11:51 schrieb Rémy Maucherat:
> > On Fri, Oct 11, 2019 at 10:30 AM  wrote:
> >
> >> This is an automated email from the ASF dual-hosted git repository.
> >>
> >> michaelo pushed a commit to branch BZ-63835/8.5.x
> >> in repository https://gitbox.apache.org/repos/asf/tomcat.git
> >>
> >> commit 6ff2233cbbd27c9c2c649208a21931e5f3e132a6
> >> Author: Michael Osipov 
> >> AuthorDate: Fri Oct 11 10:30:08 2019 +0200
> >>
> >>  First draft
> >>
> >
> > +if (keepAliveTimeout > 0) {
> > +String value = "timeout=" +
> > TimeUnit.MILLISECONDS.toSeconds(keepAliveTimeout);
> > +
> > +if (maxKeepAliveRequests > 0) {
> > +value += ", max=" + maxKeepAliveRequests;
> > +}
> > StringBuilder ?
>
> StringBuilder does not make any sense because:
>
> * The compiler will replace the static code automatically with a
> StringBuilder
> * StringBuilder gains benefit when you concat strings in a for/while/do
> loop. The above code is purely static.
>

I don't understand how this can work, or how it is static, but if you're
100% certain it's fine.


>
> > Can you add a new flag controlling the feature ? The information may not
> be
> > very useful in many cases such as when proxying, so it would be better to
> > skip generating it by default.
>
> This is -- as documented -- a first draft.
>
> As mentioned on the ticket. This is hop-by-hop and writetn only if the
> client requests this piece of information. We can surely discuss a flag
> for this on the connector.
>

Ok indeed. I never understood why some clients kept sending Connection:
keep-alive since it was also not needed.

Rémy


[Bug 63837] 7.0.97: TestAbstractAjpProcessor hangs when run with Java 13.0 and NIO.

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

--- Comment #2 from Konstantin Kolinko  ---
Created attachment 36822
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36822=edit
6852_stack.txt

Stacktrace from a hanging JVM. It was created with the following command:

jstack.exe -l -e 6852 >6852_stack.txt

-- 
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 63837] 7.0.97: TestAbstractAjpProcessor hangs when run with Java 13.0 and NIO.

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

--- Comment #1 from Konstantin Kolinko  ---
Created attachment 36821
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36821=edit
ant_test.log

stdout/stderr output of Apache Ant.

-- 
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 63837] New: 7.0.97: TestAbstractAjpProcessor hangs when run with Java 13.0 and NIO.

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

Bug ID: 63837
   Summary: 7.0.97: TestAbstractAjpProcessor hangs when run with
Java 13.0 and NIO.
   Product: Tomcat 7
   Version: trunk
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Connectors
  Assignee: dev@tomcat.apache.org
  Reporter: knst.koli...@gmail.com
  Target Milestone: ---

Testing a release candidate for 7.0.97:

The test TestAbstractAjpProcessor hangs when I run it with Java 13 (13u0 64-bit
from Oracle, running on Windows 10) and it uses a NIO connector.

If I kill the hung JVM, it completes normally for other connectors (APR, BIO).

Note: The code was previously run with Java 6 and Java 7 and the tests were
compiled by those runs. I am not sure that the code can be compiled with Java
13 as is (I remember seeing failures, not investigated).


1. I see the following error in the stdout/stderr output of Apache Ant:

[junit] Oct. 11, 2019 3:08:56 AM org.apache.coyote.AbstractProtocol init
[junit] SEVERE: Failed to initialize end point associated with
ProtocolHandler ["ajp-nio-127.0.0.1-auto-6-58537"]
[junit] java.lang.IllegalArgumentException: timeout < 0
[junit] at
java.base/sun.nio.ch.ServerSocketAdaptor.setSoTimeout(ServerSocketAdaptor.java:153)
[junit] at
org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:477)
[junit] at
org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:750)
[junit] at
org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:467)
[junit] at
org.apache.catalina.connector.Connector.initInternal(Connector.java:951)
[junit] at
org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
[junit] at
org.apache.catalina.core.StandardService.initInternal(StandardService.java:560)
[junit] at
org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
[junit] at
org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:826)
[junit] at
org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
[junit] at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
[junit] at org.apache.catalina.startup.Tomcat.start(Tomcat.java:456)
[junit] at
org.apache.catalina.startup.TomcatBaseTest$TomcatWithFastSessionIDs.start(TomcatBaseTest.java:808)

I guess that is the root cause.

2. If I use jstack.exe to get a stacktrace from hanging JVM, I see a single
client thread reading from a connection, and no Tomcat instance running.

-- 
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: Align with 8.5.x to ease back-ports.

2019-10-11 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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new e68d6f8  Align with 8.5.x to ease back-ports.
e68d6f8 is described below

commit e68d6f83e550531591bf41a172fb36fdd3393029
Author: Mark Thomas 
AuthorDate: Fri Oct 11 13:25:01 2019 +0100

Align with 8.5.x to ease back-ports.
---
 java/org/apache/coyote/AsyncStateMachine.java | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index d4df0ff..0c1bcec 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -132,8 +132,7 @@ public class AsyncStateMachine {
 /**
  * The string manager for this package.
  */
-private static final StringManager sm =
-StringManager.getManager(Constants.Package);
+private static final StringManager sm = 
StringManager.getManager(AsyncStateMachine.class);
 
 private enum AsyncState {
 DISPATCHED  (false, false, false, false),
@@ -241,11 +240,7 @@ public class AsyncStateMachine {
 } else  if (state == AsyncState.STARTING) {
 state = AsyncState.STARTED;
 return SocketState.LONG;
-} else if (state == AsyncState.MUST_COMPLETE) {
-asyncCtxt.fireOnComplete();
-state = AsyncState.DISPATCHED;
-return SocketState.ASYNC_END;
-} else if (state == AsyncState.COMPLETING) {
+} else if (state == AsyncState.MUST_COMPLETE || state == 
AsyncState.COMPLETING) {
 asyncCtxt.fireOnComplete();
 state = AsyncState.DISPATCHED;
 return SocketState.ASYNC_END;
@@ -297,7 +292,6 @@ public class AsyncStateMachine {
 throw new IllegalStateException(
 sm.getString("asyncStateMachine.invalidAsyncState",
 "asyncComplete()", state));
-
 }
 return triggerDispatch;
 }


-
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: Further align complete()/dispatch() if called during async I/O

2019-10-11 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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new d8854d9  Further align complete()/dispatch() if called during async I/O
d8854d9 is described below

commit d8854d9dec2ae2130cf30c509cfc79cbc0ec002d
Author: Mark Thomas 
AuthorDate: Fri Oct 11 11:30:00 2019 +0100

Further align complete()/dispatch() if called during async I/O
---
 java/org/apache/coyote/AsyncStateMachine.java | 37 +++
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index a1486aa..d4df0ff 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -278,22 +278,28 @@ public class AsyncStateMachine {
 
 
 private synchronized boolean doComplete() {
-boolean doComplete = false;
-if (state == AsyncState.STARTING) {
+boolean triggerDispatch = false;
+if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
+state == AsyncState.ERROR) {
+// Processing is on a container thread so no need to transfer
+// processing to a new container thread
 state = AsyncState.MUST_COMPLETE;
 } else if (state == AsyncState.STARTED || state == 
AsyncState.COMPLETE_PENDING) {
 state = AsyncState.COMPLETING;
-doComplete = true;
-} else if (state == AsyncState.TIMING_OUT ||
-state == AsyncState.ERROR) {
-state = AsyncState.MUST_COMPLETE;
+// A dispatch to a container thread is always required.
+// If on a non-container thread, need to get back onto a container
+// thread to complete the processing.
+// If on a container thread the current request/response are not 
the
+// request/response associated with the AsyncContext so need a new
+// container thread to process the different request/response.
+triggerDispatch = true;
 } else {
 throw new IllegalStateException(
 sm.getString("asyncStateMachine.invalidAsyncState",
 "asyncComplete()", state));
 
 }
-return doComplete;
+return triggerDispatch;
 }
 
 
@@ -326,28 +332,27 @@ public class AsyncStateMachine {
 
 
 private synchronized boolean doDispatch() {
-boolean doDispatch = false;
-if (state == AsyncState.STARTING ||
-state == AsyncState.TIMING_OUT ||
+boolean triggerDispatch = false;
+if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
 state == AsyncState.ERROR) {
-// In these three cases processing is on a container thread so no
-// need to transfer processing to a new container thread
+// Processing is on a container thread so no need to transfer
+// processing to a new container thread
 state = AsyncState.MUST_DISPATCH;
 } else if (state == AsyncState.STARTED || state == 
AsyncState.DISPATCH_PENDING) {
-// A dispatch is always required.
+state = AsyncState.DISPATCHING;
+// A dispatch to a container thread is always required.
 // If on a non-container thread, need to get back onto a container
 // thread to complete the processing.
 // If on a container thread the current request/response are not 
the
 // request/response associated with the AsyncContext so need a new
 // container thread to process the different request/response.
-state = AsyncState.DISPATCHING;
-doDispatch = true;
+triggerDispatch = true;
 } else {
 throw new IllegalStateException(
 sm.getString("asyncStateMachine.invalidAsyncState",
 "asyncDispatch()", state));
 }
-return doDispatch;
+return triggerDispatch;
 }
 
 


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



Possible bug in Http11Processor/SocketWrapperBase

2019-10-11 Thread Michael Osipov

Folks,

while working on BZ-63835 I have noticed an odd thing and I'd like 
someone to review whether my code/understanding is wrong or the one 
already present in Tomcat.


Note: The same code path in HTTPd behaves corectly.

Consider this output received by curl:


HTTP/1.1 302

Transfer-Encoding: chunked
Keep-Alive: timeout=300, max=100
Connection: keep-alive

HTTP/1.1 302

Transfer-Encoding: chunked
Keep-Alive: timeout=300, max=99
Connection: keep-alive

HTTP/1.1 302

...

>

HTTP/1.1 302

Transfer-Encoding: chunked
Keep-Alive: timeout=300, max=2
Connection: keep-alive

HTTP/1.1 302

Transfer-Encoding: chunked
Connection: close


we have a total of 100 requests (HTTP/1.1 302). I'd assume the 
connection to sustain 100 requests and on the n+1 requests to be closed.


This is caused by

} else if (maxKeepAliveRequests > 0 &&
socketWrapper.decrementKeepAlive() <= 0) {
keepAlive = false;
}


while decrementKeepAlive() being a predecrement, chopping off the 
current request.

Making this postdecrement the outcome is as expected:


HTTP/1.1 302

Transfer-Encoding: chunked
Keep-Alive: timeout=20, max=100
Connection: keep-alive

HTTP/1.1 302

Transfer-Encoding: chunked
Keep-Alive: timeout=20, max=99
Connection: keep-alive

...

HTTP/1.1 302

Transfer-Encoding: chunked
Keep-Alive: timeout=20, max=2
Connection: keep-alive

HTTP/1.1 302

Transfer-Encoding: chunked
Keep-Alive: timeout=20, max=1
Connection: keep-alive

HTTP/1.1 302

Transfer-Encoding: chunked
Connection: close


having 101 requests in total, matching HTTPd behavior.

The expired header proposal says:

   The value of the "max" parameter counts the number of requests since
   the connection was created.


My code is here:
https://github.com/apache/tomcat/commit/a5e3e1d7a498a3156350ae8bbed36706b2600e64

Am I wrong?

Michael

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



[Bug 63836] TestWebdavServletOptions test fails with OutOfMemoryError for NIO on 32-bit Java

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

--- Comment #3 from Konstantin Kolinko  ---
Created attachment 36820
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36820=edit
ant_test.log (zipped)

Apache Ant stdout/stderr from the run (Java 8u202 32-bit, all connectors: BIO,
NIO and APR). A 1.8 MB file compressed with zip.

The OutOfMemoryError message can be seen in it.

-- 
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 8.5.x updated: Further align complete()/dispatch() if called during async I/O

2019-10-11 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 c9a87ee  Further align complete()/dispatch() if called during async I/O
c9a87ee is described below

commit c9a87ee48982721ba2a110749e4f1704a9d3cc63
Author: Mark Thomas 
AuthorDate: Fri Oct 11 11:30:00 2019 +0100

Further align complete()/dispatch() if called during async I/O
---
 java/org/apache/coyote/AsyncStateMachine.java | 40 +++
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index cfc071a..2c2c582 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -323,17 +323,25 @@ public class AsyncStateMachine {
 boolean triggerDispatch = false;
 if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
 state == AsyncState.ERROR) {
+// Processing is on a container thread so no need to transfer
+// processing to a new container thread
 state = AsyncState.MUST_COMPLETE;
 } else if (state == AsyncState.STARTED || state == 
AsyncState.COMPLETE_PENDING) {
 state = AsyncState.COMPLETING;
+// A dispatch to a container thread is always required.
+// If on a non-container thread, need to get back onto a container
+// thread to complete the processing.
+// If on a container thread the current request/response are not 
the
+// request/response associated with the AsyncContext so need a new
+// container thread to process the different request/response.
 triggerDispatch = true;
 } else if (state == AsyncState.READ_WRITE_OP) {
 // Read/write operations can happen on or off a container thread 
but
-// the call to listener that triggers the read/write will always be
-// on a container thread and the socket will be added to the poller
-// when the thread exits the AbstractConnectionHandler.process()
-// method so don't do a dispatch here which would add it to the
-// poller a second time.
+// while in this state the call to listener that triggers the
+// read/write will be in progress on a container thread.
+// The socket will be added to the poller when the container thread
+// exits the AbstractConnectionHandler.process() method so don't do
+// a dispatch here which would add it to the poller a second time.
 state = AsyncState.COMPLETING;
 } else {
 throw new IllegalStateException(
@@ -375,15 +383,14 @@ public class AsyncStateMachine {
 private synchronized boolean doDispatch() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING ||
-state == AsyncState.TIMING_OUT ||
+if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
 state == AsyncState.ERROR) {
-// In these three cases processing is on a container thread so no
-// need to transfer processing to a new container thread
+// Processing is on a container thread so no need to transfer
+// processing to a new container thread
 state = AsyncState.MUST_DISPATCH;
 } else if (state == AsyncState.STARTED || state == 
AsyncState.DISPATCH_PENDING) {
 state = AsyncState.DISPATCHING;
-// A dispatch is always required.
+// A dispatch to a container thread is always required.
 // If on a non-container thread, need to get back onto a container
 // thread to complete the processing.
 // If on a container thread the current request/response are not 
the
@@ -391,14 +398,13 @@ public class AsyncStateMachine {
 // container thread to process the different request/response.
 triggerDispatch = true;
 } else if (state == AsyncState.READ_WRITE_OP) {
+// Read/write operations can happen on or off a container thread 
but
+// while in this state the call to listener that triggers the
+// read/write will be in progress on a container thread.
+// The socket will be added to the poller when the container thread
+// exits the AbstractConnectionHandler.process() method so don't do
+// a dispatch here which would add it to the poller a second time.
 state = AsyncState.DISPATCHING;
-// If on a container thread then the socket will be added to the
-// poller when the thread exits the
-// 

[tomcat] branch master updated: Further align complete()/dispatch() if called during async I/O

2019-10-11 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 db7e2d2  Further align complete()/dispatch() if called during async I/O
db7e2d2 is described below

commit db7e2d21cd76e2dfba5262fc1231ff7bd4eec2bf
Author: Mark Thomas 
AuthorDate: Fri Oct 11 11:30:00 2019 +0100

Further align complete()/dispatch() if called during async I/O
---
 java/org/apache/coyote/AsyncStateMachine.java | 40 +++
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/java/org/apache/coyote/AsyncStateMachine.java 
b/java/org/apache/coyote/AsyncStateMachine.java
index 9f8a489..6d66567 100644
--- a/java/org/apache/coyote/AsyncStateMachine.java
+++ b/java/org/apache/coyote/AsyncStateMachine.java
@@ -323,17 +323,25 @@ class AsyncStateMachine {
 boolean triggerDispatch = false;
 if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
 state == AsyncState.ERROR) {
+// Processing is on a container thread so no need to transfer
+// processing to a new container thread
 state = AsyncState.MUST_COMPLETE;
 } else if (state == AsyncState.STARTED || state == 
AsyncState.COMPLETE_PENDING) {
 state = AsyncState.COMPLETING;
+// A dispatch to a container thread is always required.
+// If on a non-container thread, need to get back onto a container
+// thread to complete the processing.
+// If on a container thread the current request/response are not 
the
+// request/response associated with the AsyncContext so need a new
+// container thread to process the different request/response.
 triggerDispatch = true;
 } else if (state == AsyncState.READ_WRITE_OP) {
 // Read/write operations can happen on or off a container thread 
but
-// the call to listener that triggers the read/write will always be
-// on a container thread and the socket will be added to the poller
-// when the thread exits the AbstractConnectionHandler.process()
-// method so don't do a dispatch here which would add it to the
-// poller a second time.
+// while in this state the call to listener that triggers the
+// read/write will be in progress on a container thread.
+// The socket will be added to the poller when the container thread
+// exits the AbstractConnectionHandler.process() method so don't do
+// a dispatch here which would add it to the poller a second time.
 state = AsyncState.COMPLETING;
 } else {
 throw new IllegalStateException(
@@ -375,15 +383,14 @@ class AsyncStateMachine {
 private synchronized boolean doDispatch() {
 clearNonBlockingListeners();
 boolean triggerDispatch = false;
-if (state == AsyncState.STARTING ||
-state == AsyncState.TIMING_OUT ||
+if (state == AsyncState.STARTING || state == AsyncState.TIMING_OUT ||
 state == AsyncState.ERROR) {
-// In these three cases processing is on a container thread so no
-// need to transfer processing to a new container thread
+// Processing is on a container thread so no need to transfer
+// processing to a new container thread
 state = AsyncState.MUST_DISPATCH;
 } else if (state == AsyncState.STARTED || state == 
AsyncState.DISPATCH_PENDING) {
 state = AsyncState.DISPATCHING;
-// A dispatch is always required.
+// A dispatch to a container thread is always required.
 // If on a non-container thread, need to get back onto a container
 // thread to complete the processing.
 // If on a container thread the current request/response are not 
the
@@ -391,14 +398,13 @@ class AsyncStateMachine {
 // container thread to process the different request/response.
 triggerDispatch = true;
 } else if (state == AsyncState.READ_WRITE_OP) {
+// Read/write operations can happen on or off a container thread 
but
+// while in this state the call to listener that triggers the
+// read/write will be in progress on a container thread.
+// The socket will be added to the poller when the container thread
+// exits the AbstractConnectionHandler.process() method so don't do
+// a dispatch here which would add it to the poller a second time.
 state = AsyncState.DISPATCHING;
-// If on a container thread then the socket will be added to the
-// poller when the thread exits the
-// 

[Bug 63836] TestWebdavServletOptions test fails with OutOfMemoryError for NIO on 32-bit Java

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

--- Comment #2 from Konstantin Kolinko  ---
Created attachment 36819
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36819=edit
TEST-org.apache.catalina.servlets.TestWebdavServletOptions.APR.txt

Output from a successful run (Java 8u202 32-bit, APR)

-- 
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 63836] TestWebdavServletOptions test fails with OutOfMemoryError for NIO on 32-bit Java

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

--- Comment #1 from Konstantin Kolinko  ---
Created attachment 36818
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36818=edit
TEST-org.apache.catalina.servlets.TestWebdavServletOptions.NIO.txt

Output from a failing run (Java 8u202 32-bit, NIO)

-- 
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 63836] New: TestWebdavServletOptions test fails with OutOfMemoryError for NIO on 32-bit Java

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

Bug ID: 63836
   Summary: TestWebdavServletOptions test fails with
OutOfMemoryError for NIO on 32-bit Java
   Product: Tomcat 7
   Version: 7.0.96
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: knst.koli...@gmail.com
  Target Milestone: ---

I encountered this issue when testing a 7.0.97 release candidate.

The test "org.apache.catalina.servlets.TestWebdavServletOptions" fails for NIO
connector when I run the tests with a 32-bit JVM.

Essentially, it is a parameterized test (@RunWith(Parameterized.class)) that
has 312 iterations. Each iteration creates a Servlet, starts Tomcat and does
two requests (OPTIONS, and one of other HTTP methods). Processing a request may
involve reading a resource.

I am testing with different versions of Java on Windows 10. I start Apache Ant
from a command line, without an IDE.

Thus far I know the following:

1. The test fails reliably when I run the test alone. (Running a single test is
done by adding the following line to build.properties:

test.entry=org.apache.catalina.servlets.TestWebdavServletOptions

2. The test fails for NIO connector only and a 32-bit JDK.

- It completes successfully for BIO and APR.

- It fails for 32-bit Java 6u45, 7u80, 8u202. It completes successfully for
64-bit 8u222, 13u0.

3. The same test exists in Tomcat 8.5.47 and it completes successfully there. I
did run it with 32-bit Java 7u80.

4. When the test fails:

- TEST-org.apache.catalina.servlets.TestWebdavServletOptions.NIO.txt
This file is essentially empty, with a message "Forked Java VM exited
abnormally." and no other details.

- The error can be seen in stdout/stderr output of Apache Ant.

a. The test runs successfully up to iteration 235
(iterations are numbered starting with 0)

> [junit] INFO: Starting test case [testOptions[234]]
> ... (followed by log messages of starting and stopping Apache Tomcat)

b. Starting with iteration 236 and  I see only two messages:

> [junit] INFO: Starting test case [testOptions[235]]
> [junit] INFO: Initializing ProtocolHandler ["http-nio-127.0.0.1-auto-236"]

There are no other startup or shutdown messages following.

c. After iteration 309 (out of total 312) the run is aborted with an OOME

> [junit] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space


5. I tried to investigate this as a regression and bisect.
My result is that this is not a regression. I was not able to find a
non-failing version.

a. The test fails with current 7.0.x branch head (as of 2019-10-10), with
7.0.97 and 7.0.96.

b. The test fails on the commit when it was added to the source tree
(aed9453c710bafce9d69c5d4ea02363d371b8a32 on 2019-06-29). This was between
versions 7.0.94 and 7.0.95.

c. If I backport the test implementation (the test/** changes from aed9453c71,
I observe the same OutOfMemoryError for versions 7.0.94, 7.0.93, 7.0.92 and
7.0.80.

6. A trivial attempt of a fix by patching TomcatBaseTest.tearDown() by
explicitly releasing a reference to a Tomcat instance - does not help

--- a/test/org/apache/catalina/startup/TomcatBaseTest.java
+++ b/test/org/apache/catalina/startup/TomcatBaseTest.java
@@ -176,6 +176,7 @@ public abstract class TomcatBaseTest extends
LoggingBaseTest {
 }
 } finally {
 super.tearDown();
+tomcat = null;
 }
 }

I see the same OutOfMemoryError.

Judging from point 5.c. I think this is not a regression and not a showstopper.
If it were, I think there would have been other evidences in the two years
since 7.0.80.

It might be an issue with the test itself, but it is strange that it manifests
itself only when running with a NIO connector. The overhead from JUnit, from
test set up, from resources being served, from the size of a web application
should be the same.

I think that a good next step from here would be to take a memory dump and to
analyze it with a profiler.

-- 
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: [tomcat] branch BZ-63835/8.5.x created (now 6ff2233)

2019-10-11 Thread Michael Osipov

Am 2019-10-11 um 11:32 schrieb Rémy Maucherat:

On Fri, Oct 11, 2019 at 10:43 AM Mark Thomas  wrote:


On 11/10/2019 09:30, micha...@apache.org wrote:

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch BZ-63835/8.5.x


New features should be implemented against master and then back-ported
(assuming the community accepts them).



I also (still) prefer either PRs (it allows comments) or in master.


This is a first draft, nothing PR worthy. As soon as I see the code 
working, I will create the PR by then and when approved in general I 
will add tests and re-request review. So please be patient.


Michael


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



Re: [tomcat] 01/01: First draft

2019-10-11 Thread Michael Osipov

Am 2019-10-11 um 11:51 schrieb Rémy Maucherat:

On Fri, Oct 11, 2019 at 10:30 AM  wrote:


This is an automated email from the ASF dual-hosted git repository.

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

commit 6ff2233cbbd27c9c2c649208a21931e5f3e132a6
Author: Michael Osipov 
AuthorDate: Fri Oct 11 10:30:08 2019 +0200

 First draft



+if (keepAliveTimeout > 0) {
+String value = "timeout=" +
TimeUnit.MILLISECONDS.toSeconds(keepAliveTimeout);
+
+if (maxKeepAliveRequests > 0) {
+value += ", max=" + maxKeepAliveRequests;
+}
StringBuilder ?


StringBuilder does not make any sense because:

* The compiler will replace the static code automatically with a 
StringBuilder
* StringBuilder gains benefit when you concat strings in a for/while/do 
loop. The above code is purely static.



Can you add a new flag controlling the feature ? The information may not be
very useful in many cases such as when proxying, so it would be better to
skip generating it by default.


This is -- as documented -- a first draft.

As mentioned on the ticket. This is hop-by-hop and writetn only if the 
client requests this piece of information. We can surely discuss a flag 
for this on the connector.



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



[tomcat] branch BZ-63835/8.5.x updated: Properly determine requests left on a "keepAlive" connection

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

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


The following commit(s) were added to refs/heads/BZ-63835/8.5.x by this push:
 new d758805  Properly determine requests left on a "keepAlive" connection
d758805 is described below

commit d7588053eba6699d17a1f4bf524597e0c1765fd9
Author: Michael Osipov 
AuthorDate: Fri Oct 11 12:51:44 2019 +0200

Properly determine requests left on a "keepAlive" connection
---
 java/org/apache/coyote/http11/Http11Processor.java | 8 +++-
 java/org/apache/tomcat/util/net/SocketWrapperBase.java | 3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 3182bb7..78b1d7b 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1386,7 +1386,13 @@ public class Http11Processor extends AbstractProcessor {
 String value = "timeout=" + 
TimeUnit.MILLISECONDS.toSeconds(keepAliveTimeout);
 
 if (maxKeepAliveRequests > 0) {
-value += ", max=" + maxKeepAliveRequests;
+/*
+ * We need to add 1 here because the value is already 
decremented in
+ * service() by 1. Otherwise the client would see 99 
on the first request.
+ * In HTTPd this value is modified after this code 
block has been run.
+ */
+int left = socketWrapper.getKeepAliveLeft() + 1;
+value += ", max=" + left;
 }
 
 headers.setValue("Keep-Alive").setString(value);
diff --git a/java/org/apache/tomcat/util/net/SocketWrapperBase.java 
b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
index 658d4e4..556b05b 100644
--- a/java/org/apache/tomcat/util/net/SocketWrapperBase.java
+++ b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
@@ -170,8 +170,9 @@ public abstract class SocketWrapperBase {
 }
 
 
+public int getKeepAliveLeft() { return keepAliveLeft; }
 public void setKeepAliveLeft(int keepAliveLeft) { this.keepAliveLeft = 
keepAliveLeft;}
-public int decrementKeepAlive() { return (--keepAliveLeft);}
+public int decrementKeepAlive() { return (keepAliveLeft--);}
 
 public String getRemoteHost() {
 if (remoteHost == null) {


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



[tomcat] branch BZ-63835/9.0.x created (now a5e3e1d)

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

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


  at a5e3e1d  Properly determine requests left on a "keepAlive" connection

This branch includes the following new commits:

 new f903e1f  First draft
 new a5e3e1d  Properly determine requests left on a "keepAlive" connection

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.



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



[tomcat] 01/02: First draft

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

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

commit f903e1fe0d3902111b626e82d201d7598a15118e
Author: Michael Osipov 
AuthorDate: Fri Oct 11 10:30:08 2019 +0200

First draft
---
 java/org/apache/coyote/http11/Http11Processor.java | 36 ++
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index a176206..7bc50a4 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -21,6 +21,7 @@ import java.io.InterruptedIOException;
 import java.nio.ByteBuffer;
 import java.util.Enumeration;
 import java.util.Locale;
+import java.util.concurrent.TimeUnit;
 import java.util.regex.Pattern;
 
 import javax.servlet.http.HttpServletResponse;
@@ -913,7 +914,7 @@ public class Http11Processor extends AbstractProcessor {
 } else {
 // If the response code supports an entity body and we're on
 // HTTP 1.1 then we chunk unless we have a Connection: close header
-connectionClosePresent = isConnectionClose(headers);
+connectionClosePresent = isConnectionValue(headers, 
Constants.CLOSE);
 if (http11 && entityBody && !connectionClosePresent) {
 
outputBuffer.addActiveFilter(outputFilters[Constants.CHUNKED_FILTER]);
 contentDelimitation = true;
@@ -957,10 +958,33 @@ public class Http11Processor extends AbstractProcessor {
 headers.addValue(Constants.CONNECTION).setString(
 Constants.CLOSE);
 }
-} else if (!http11 && !getErrorState().isError()) {
-
headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
-}
+} else if (!getErrorState().isError()) {
+if (!http11) {
+
headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
+}
+
+boolean connectionKeepAlivePresent =
+isConnectionValue(request.getMimeHeaders(), 
Constants.KEEPALIVE);
+
+if (connectionKeepAlivePresent) {
+int keepAliveTimeout = protocol.getKeepAliveTimeout();
+int maxKeepAliveRequests = protocol.getMaxKeepAliveRequests();
+
+if (keepAliveTimeout > 0) {
+String value = "timeout=" + 
TimeUnit.MILLISECONDS.toSeconds(keepAliveTimeout);
+
+if (maxKeepAliveRequests > 0) {
+value += ", max=" + maxKeepAliveRequests;
+}
 
+headers.setValue("Keep-Alive").setString(value);
+}
+
+if (http11) {
+
headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
+}
+}
+}
 // Add server header
 String server = protocol.getServer();
 if (server == null) {
@@ -992,12 +1016,12 @@ public class Http11Processor extends AbstractProcessor {
 outputBuffer.commit();
 }
 
-private static boolean isConnectionClose(MimeHeaders headers) {
+private static boolean isConnectionValue(MimeHeaders headers, String 
value) {
 MessageBytes connection = headers.getValue(Constants.CONNECTION);
 if (connection == null) {
 return false;
 }
-return connection.equals(Constants.CLOSE);
+return connection.equals(value);
 }
 
 private void prepareSendfile(OutputFilter[] outputFilters) {


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



[tomcat] 02/02: Properly determine requests left on a "keepAlive" connection

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

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

commit a5e3e1d7a498a3156350ae8bbed36706b2600e64
Author: Michael Osipov 
AuthorDate: Fri Oct 11 12:51:44 2019 +0200

Properly determine requests left on a "keepAlive" connection
---
 java/org/apache/coyote/http11/Http11Processor.java | 8 +++-
 java/org/apache/tomcat/util/net/SocketWrapperBase.java | 6 +-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 7bc50a4..314c3d1 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -974,7 +974,13 @@ public class Http11Processor extends AbstractProcessor {
 String value = "timeout=" + 
TimeUnit.MILLISECONDS.toSeconds(keepAliveTimeout);
 
 if (maxKeepAliveRequests > 0) {
-value += ", max=" + maxKeepAliveRequests;
+/*
+ * We need to add 1 here because the value is already 
decremented in
+ * service() by 1. Otherwise the client would see 99 
on the first request.
+ * In HTTPd this value is modified after this code 
block has been run.
+ */
+int left = socketWrapper.getKeepAliveLeft() + 1;
+value += ", max=" + left;
 }
 
 headers.setValue("Keep-Alive").setString(value);
diff --git a/java/org/apache/tomcat/util/net/SocketWrapperBase.java 
b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
index 2c082d6..154c9c7 100644
--- a/java/org/apache/tomcat/util/net/SocketWrapperBase.java
+++ b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
@@ -212,12 +212,16 @@ public abstract class SocketWrapperBase {
 return this.writeTimeout;
 }
 
+public int getKeepAliveLeft() {
+return keepAliveLeft;
+}
+
 public void setKeepAliveLeft(int keepAliveLeft) {
 this.keepAliveLeft = keepAliveLeft;
 }
 
 public int decrementKeepAlive() {
-return --keepAliveLeft;
+return keepAliveLeft--;
 }
 
 public String getRemoteHost() {


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



[Bug 63835] Add support for Keep-Alive header

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

--- Comment #4 from Michael Osipov  ---
(In reply to Remy Maucherat from comment #3)
> This feature idea doesn't look good to me:
> - What if there's a proxy ? [usually, there is a proxy]
> - This feature looks very late 90s ish and it wasn't added then

This header is a hop-by-hop. If there is a proxy the proxy will read it and
adjust. The clieant won't see, but atmost the real values.
I will test this with HTTPd too and see how it behaves.

HTTPd does strip that:
https://github.com/apache/httpd/blob/2.4.x/modules/proxy/proxy_util.c#L3780-L3796

Please also consider that this gets activated if and only if "Connection:
keep-alive" is sent by the client.

-- 
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: r36294 - /dev/tomcat/tomcat-8/v8.5.47/ /release/tomcat/tomcat-8/v8.5.47/

2019-10-11 Thread markt
Author: markt
Date: Fri Oct 11 10:45:29 2019
New Revision: 36294

Log:
Release Apache Tomcat 8.5.47

Added:
release/tomcat/tomcat-8/v8.5.47/
  - copied from r36293, dev/tomcat/tomcat-8/v8.5.47/
Removed:
dev/tomcat/tomcat-8/v8.5.47/


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



Nexus: Promotion Completed

2019-10-11 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.7.0_80; Windows 7 6.1)""userId" = "markt""ip" = "86.144.250.12"Details:The following artifacts have been promoted to the "Releases" [id=releases] repository/org/apache/tomcat/tomcat-i18n-de/8.5.47/tomcat-i18n-de-8.5.47.pom.asc(SHA1: 7783f1c2b83bbfc67582e6f3164a4083b43a6141)/org/apache/tomcat/tomcat-i18n-de/8.5.47/tomcat-i18n-de-8.5.47.jar(SHA1: e3d97141085bbc044b405cc6d94b785ce00f099b)/org/apache/tomcat/tomcat-i18n-de/8.5.47/tomcat-i18n-de-8.5.47.jar.asc(SHA1: f197744e7e1480238d65fa74df44816033a8a2e2)/org/apache/tomcat/tomcat-i18n-de/8.5.47/tomcat-i18n-de-8.5.47.pom(SHA1: dbfbff2b691d2ccd853473a83cfe8f96ed07d620)/org/apache/tomcat/tomcat-jni/8.5.47/tomcat-jni-8.5.47.pom.asc(SHA1: 2054a5a672486763706c6f3cd1ad64a20bd2b8df)/org/apache/tomcat/tomcat-jni/8.5.47/tomcat-jni-8.5.47.jar(SHA1: e4f1e29c811298ff42007d36ae63d6f2c8855e53)/org/apache/tomcat/tomcat-jni/8.5.47/tomcat-jni-8.5.47-sources.jar(SHA1: 70389bc7cfae3691a6d997d0324a4155febdb7b8)/org/apache/tomcat/tomcat-jni/8.5.47/tomcat-jni-8.5.47.jar.asc(SHA1: a7cf08c588ecf3a93be6bdd0e27cf87a8904d245)/org/apache/tomcat/tomcat-jni/8.5.47/tomcat-jni-8.5.47.pom(SHA1: 48fdf7af78cb369400b2a6ffdbb26cb1510471e0)/org/apache/tomcat/tomcat-jni/8.5.47/tomcat-jni-8.5.47-sources.jar.asc(SHA1: e66796e93e81d2322c2cdac3c56fb46a65d6d7da)/org/apache/tomcat/tomcat-juli/8.5.47/tomcat-juli-8.5.47.pom.asc(SHA1: dc4dd2530dcc4f200560febde993143db0dc3590)/org/apache/tomcat/tomcat-juli/8.5.47/tomcat-juli-8.5.47-sources.jar.asc(SHA1: 015e7c8e685c0cbc1e8bcc62797aad8d1d0ded4a)/org/apache/tomcat/tomcat-juli/8.5.47/tomcat-juli-8.5.47.jar(SHA1: c011f98bd9ca60582547c98f5dd3a4dc56decfda)/org/apache/tomcat/tomcat-juli/8.5.47/tomcat-juli-8.5.47.pom(SHA1: 47710b52f3313f19003bd0a8371ea78a127307b2)/org/apache/tomcat/tomcat-juli/8.5.47/tomcat-juli-8.5.47.jar.asc(SHA1: 841d3e61be33e2980e0421ae9bdcd13c6d6c3f3d)/org/apache/tomcat/tomcat-juli/8.5.47/tomcat-juli-8.5.47-sources.jar(SHA1: 70080e1fe73e21f9179a9a10cee0388b43a91f22)/org/apache/tomcat/tomcat-util/8.5.47/tomcat-util-8.5.47.jar.asc(SHA1: 8a645324f77300169bd52d639bf442e48ad5f94a)/org/apache/tomcat/tomcat-util/8.5.47/tomcat-util-8.5.47.jar(SHA1: dd21106a7dd96b67b218b90e142b8055e6874ef9)/org/apache/tomcat/tomcat-util/8.5.47/tomcat-util-8.5.47-sources.jar(SHA1: cffb928afc7ad5544f445069f1d1d59bb33a)/org/apache/tomcat/tomcat-util/8.5.47/tomcat-util-8.5.47.pom(SHA1: fdad95d44a267e29fa44215449f2a06cb25bd77e)/org/apache/tomcat/tomcat-util/8.5.47/tomcat-util-8.5.47.pom.asc(SHA1: 73e9e7fee42de388e979d45568a7ecf3e176b95e)/org/apache/tomcat/tomcat-util/8.5.47/tomcat-util-8.5.47-sources.jar.asc(SHA1: ef2911d4f5e942abffc5b8215e571019fe9e32ea)/org/apache/tomcat/tomcat-catalina/8.5.47/tomcat-catalina-8.5.47.pom(SHA1: 3256fd7bd06ddcb63f713bc5d669d356c5765828)/org/apache/tomcat/tomcat-catalina/8.5.47/tomcat-catalina-8.5.47.jar.asc(SHA1: 4758ace78d020800bef6e556b4fccbf7822a29c6)/org/apache/tomcat/tomcat-catalina/8.5.47/tomcat-catalina-8.5.47.jar(SHA1: 018c5618212bc4f3cb8c591696cad6b5463b9728)/org/apache/tomcat/tomcat-catalina/8.5.47/tomcat-catalina-8.5.47-sources.jar(SHA1: 9c5fd28a62c1af193fa8e1a63eeca5f51fdc3484)/org/apache/tomcat/tomcat-catalina/8.5.47/tomcat-catalina-8.5.47.pom.asc(SHA1: b912ce8d66fa4ce9ee6ffdf271b2f2e351e2ce9e)/org/apache/tomcat/tomcat-catalina/8.5.47/tomcat-catalina-8.5.47-sources.jar.asc(SHA1: 7abd6699af95c97cbe70613d630d018bfb8981c5)/org/apache/tomcat/tomcat-catalina-ws/8.5.47/tomcat-catalina-ws-8.5.47-sources.jar(SHA1: 732b992d1ebc8df82b9be4421d981bc357a45549)/org/apache/tomcat/tomcat-catalina-ws/8.5.47/tomcat-catalina-ws-8.5.47.jar.asc(SHA1: 3288d29fe0d471d2413fc2c5e92e698df5f606f7)/org/apache/tomcat/tomcat-catalina-ws/8.5.47/tomcat-catalina-ws-8.5.47.jar(SHA1: 5a9f2d02c2ec033c9235cb747703894e2f5c4108)/org/apache/tomcat/tomcat-catalina-ws/8.5.47/tomcat-catalina-ws-8.5.47-sources.jar.asc(SHA1: b3facd4632126eb8ee272218de6c7d591324a663)/org/apache/tomcat/tomcat-catalina-ws/8.5.47/tomcat-catalina-ws-8.5.47.pom.asc(SHA1: a3b251f2b60a2fecbe02e6766487f78d86371102)/org/apache/tomcat/tomcat-catalina-ws/8.5.47/tomcat-catalina-ws-8.5.47.pom(SHA1: 03d156eccfc93bbad9f3c02b89195cbcc48b8489)/org/apache/tomcat/tomcat-i18n-fr/8.5.47/tomcat-i18n-fr-8.5.47.jar(SHA1: c2c538ce0b43f9ab357daafca7cb8ca2024dd8d7)/org/apache/tomcat/tomcat-i18n-fr/8.5.47/tomcat-i18n-fr-8.5.47.pom.asc(SHA1: 2765056e9fe9884b6e9c79f103f1486e8747b55e)/org/apache/tomcat/tomcat-i18n-fr/8.5.47/tomcat-i18n-fr-8.5.47.jar.asc(SHA1: 412395bc10e03f5ed6d4ca5b2178c8f363190c64)/org/apache/tomcat/tomcat-i18n-fr/8.5.47/tomcat-i18n-fr-8.5.47.pom(SHA1: 46ef3fd6def3852c48d096812007df7f1e5e9324)/org/apache/tomcat/tomcat-jdbc/8.5.47/tomcat-jdbc-8.5.47.pom(SHA1: d1eed5c0191239c1fa8d8edd19a427794040bacf)/org/apache/tomcat/tomcat-jdbc/8.5.47/tomcat-jdbc-8.5.47.jar.asc(SHA1: 994724abf3e501d2486bb8a2ef28e916f7153242)/org/apache/tomcat/tomcat-jdbc/8.5.47/tomcat-jdbc-8.5.47.jar(SHA1: 

[VOTE][RESULT] Release Apache Tomcat 8.5.47

2019-10-11 Thread Mark Thomas
The following votes were cast:

Binding:
+1: remm, michaelo, kkolinko, markt

No other votes were cast.

This vote therefore passes.

Thanks to everyone who contributed to this release.

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



Re: [VOTE] Release Apache Tomcat 8.5.47

2019-10-11 Thread Mark Thomas
On 07/10/2019 14:58, Mark Thomas wrote:

> The proposed 8.5.47 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 8.5.47

Unit tests pass for NIO, NIO2 and APR/native with Tomcat Native 1.2.23
on Linux, Windows and MacOS.

Mark

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



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

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

Remy Maucherat  changed:

   What|Removed |Added

 OS||All

--- Comment #1 from Remy Maucherat  ---
The exception is properly caught, *but* because of the severity of it it is
allowed to fall through (java.lang.InternalError is a VirtualMachineError).
Then the stop process does not complete due to that.

The code causing the error is reconstructing the class name from a Class
object, so it's rather worrying/weird that it fails.

IMO, the fix is in the InlineExecutorService: it should emulate an executor
with a one thread pool, so it should not propagate an exception/error out of
its execute method and log the trace as severe instead. I will attepmt a fix
and see how testing goes.

-- 
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: [tomcat] 01/01: First draft

2019-10-11 Thread Rémy Maucherat
On Fri, Oct 11, 2019 at 10:30 AM  wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> michaelo pushed a commit to branch BZ-63835/8.5.x
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
>
> commit 6ff2233cbbd27c9c2c649208a21931e5f3e132a6
> Author: Michael Osipov 
> AuthorDate: Fri Oct 11 10:30:08 2019 +0200
>
> First draft
>

+if (keepAliveTimeout > 0) {
+String value = "timeout=" +
TimeUnit.MILLISECONDS.toSeconds(keepAliveTimeout);
+
+if (maxKeepAliveRequests > 0) {
+value += ", max=" + maxKeepAliveRequests;
+}
StringBuilder ?

Can you add a new flag controlling the feature ? The information may not be
very useful in many cases such as when proxying, so it would be better to
skip generating it by default.

Rémy


> ---
>  java/org/apache/coyote/http11/Http11Processor.java | 36
> ++
>  1 file changed, 30 insertions(+), 6 deletions(-)
>
> diff --git a/java/org/apache/coyote/http11/Http11Processor.java
> b/java/org/apache/coyote/http11/Http11Processor.java
> index 6072602..3182bb7 100644
> --- a/java/org/apache/coyote/http11/Http11Processor.java
> +++ b/java/org/apache/coyote/http11/Http11Processor.java
> @@ -23,6 +23,7 @@ import java.util.Enumeration;
>  import java.util.Locale;
>  import java.util.Map;
>  import java.util.Set;
> +import java.util.concurrent.TimeUnit;
>  import java.util.regex.Pattern;
>
>  import javax.servlet.http.HttpServletResponse;
> @@ -1307,7 +1308,7 @@ public class Http11Processor extends
> AbstractProcessor {
>  } else {
>  // If the response code supports an entity body and we're on
>  // HTTP 1.1 then we chunk unless we have a Connection: close
> header
> -connectionClosePresent = isConnectionClose(headers);
> +connectionClosePresent = isConnectionValue(headers,
> Constants.CLOSE);
>  if (entityBody && http11 && !connectionClosePresent) {
>  outputBuffer.addActiveFilter
>  (outputFilters[Constants.CHUNKED_FILTER]);
> @@ -1369,10 +1370,33 @@ public class Http11Processor extends
> AbstractProcessor {
>  headers.addValue(Constants.CONNECTION).setString(
>  Constants.CLOSE);
>  }
> -} else if (!http11 && !getErrorState().isError()) {
> -
> headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
> -}
> +} else if (!getErrorState().isError()) {
> +if (!http11) {
> +
> headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
> +}
> +
> +boolean connectionKeepAlivePresent =
> +isConnectionValue(request.getMimeHeaders(),
> Constants.KEEPALIVE);
> +
> +if (connectionKeepAlivePresent) {
> +int keepAliveTimeout = endpoint.getKeepAliveTimeout();
> +int maxKeepAliveRequests = getMaxKeepAliveRequests();
> +
> +if (keepAliveTimeout > 0) {
> +String value = "timeout=" +
> TimeUnit.MILLISECONDS.toSeconds(keepAliveTimeout);
> +
> +if (maxKeepAliveRequests > 0) {
> +value += ", max=" + maxKeepAliveRequests;
> +}
>
> +headers.setValue("Keep-Alive").setString(value);
> +}
> +
> +if (http11) {
> +
> headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
> +}
> +}
> +}
>  // Add server header
>  if (server == null) {
>  if (serverRemoveAppProvidedValues) {
> @@ -1403,12 +1427,12 @@ public class Http11Processor extends
> AbstractProcessor {
>  outputBuffer.commit();
>  }
>
> -private static boolean isConnectionClose(MimeHeaders headers) {
> +private static boolean isConnectionValue(MimeHeaders headers, String
> value) {
>  MessageBytes connection = headers.getValue(Constants.CONNECTION);
>  if (connection == null) {
>  return false;
>  }
> -return connection.equals(Constants.CLOSE);
> +return connection.equals(value);
>  }
>
>  private void prepareSendfile(OutputFilter[] outputFilters) {
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


Re: [tomcat] branch BZ-63835/8.5.x created (now 6ff2233)

2019-10-11 Thread Rémy Maucherat
On Fri, Oct 11, 2019 at 10:43 AM Mark Thomas  wrote:

> On 11/10/2019 09:30, micha...@apache.org wrote:
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > michaelo pushed a change to branch BZ-63835/8.5.x
>
> New features should be implemented against master and then back-ported
> (assuming the community accepts them).
>

I also (still) prefer either PRs (it allows comments) or in master.

Rémy


>
> Mark
>
>
> > in repository https://gitbox.apache.org/repos/asf/tomcat.git.
> >
> >
> >   at 6ff2233  First draft
> >
> > This branch includes the following new commits:
> >
> >  new 6ff2233  First draft
> >
> > The 1 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.
> >
> >
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: dev-h...@tomcat.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


[Bug 63835] Add support for Keep-Alive header

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

--- Comment #3 from Remy Maucherat  ---
This feature idea doesn't look good to me:
- What if there's a proxy ? [usually, there is a proxy]
- This feature looks very late 90s ish and it wasn't added then

-- 
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 63835] Add support for Keep-Alive header

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

--- Comment #2 from Michael Osipov  ---
The implementation contains a bug where the max value must be decreasing. This
value can be is available on the endpoint, but there is no getter for. The
decrementKeepAliveRequests output is not stored. This would be similar too:

> int left = r->server->keep_alive_max - r->connection->keepalives;

-- 
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: r36289 - /dev/tomcat/tomcat-9/v9.0.27/ /release/tomcat/tomcat-9/v9.0.27/

2019-10-11 Thread markt
Author: markt
Date: Fri Oct 11 08:45:57 2019
New Revision: 36289

Log:
Release Apache Tomcat 9.0.27

Added:
release/tomcat/tomcat-9/v9.0.27/
  - copied from r36288, dev/tomcat/tomcat-9/v9.0.27/
Removed:
dev/tomcat/tomcat-9/v9.0.27/


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



Re: [tomcat] branch BZ-63835/8.5.x created (now 6ff2233)

2019-10-11 Thread Mark Thomas
On 11/10/2019 09:30, micha...@apache.org wrote:
> This is an automated email from the ASF dual-hosted git repository.
> 
> michaelo pushed a change to branch BZ-63835/8.5.x

New features should be implemented against master and then back-ported
(assuming the community accepts them).

Mark


> in repository https://gitbox.apache.org/repos/asf/tomcat.git.
> 
> 
>   at 6ff2233  First draft
> 
> This branch includes the following new commits:
> 
>  new 6ff2233  First draft
> 
> The 1 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.
> 
> 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


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



[VOTE][RESULT] Release Apache Tomcat 9.0.27

2019-10-11 Thread Mark Thomas
The following votes were cast:

Binding:
+1: remm, ebourg, csutherl, mgrigorov, kkolinko, markt

No other votes were cast.

The vote therefore passes.

Thanks to everyone who contributed to this release.

Mark

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



Nexus: Promotion Completed

2019-10-11 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.8.0_222; Windows 7 6.1)""userId" = "markt""ip" = "86.144.250.12"Details:The following artifacts have been promoted to the "Releases" [id=releases] repository/org/apache/tomcat/tomcat-i18n-de/9.0.27/tomcat-i18n-de-9.0.27.pom(SHA1: 6c855c996791dc947122effaaa5f7beec8229d48)/org/apache/tomcat/tomcat-i18n-de/9.0.27/tomcat-i18n-de-9.0.27.jar(SHA1: 9ab76d94147206beaba38384ed85c1e8de4ea071)/org/apache/tomcat/tomcat-i18n-de/9.0.27/tomcat-i18n-de-9.0.27.jar.asc(SHA1: 0f98e80d66d609a374f951f8e42f44975a540c7a)/org/apache/tomcat/tomcat-i18n-de/9.0.27/tomcat-i18n-de-9.0.27.pom.asc(SHA1: 9b804c0fc2d8aeaccbfcc42fd46e718e90ca652b)/org/apache/tomcat/tomcat-jni/9.0.27/tomcat-jni-9.0.27.jar(SHA1: 486998238f398c042743c83f2360eb98b5d25a8b)/org/apache/tomcat/tomcat-jni/9.0.27/tomcat-jni-9.0.27.pom(SHA1: 5add2a7813caa454688891a6cb92ad367101f7bd)/org/apache/tomcat/tomcat-jni/9.0.27/tomcat-jni-9.0.27-sources.jar(SHA1: 95f6facd9b824a04f05cb990716ec8c8d38fa3ca)/org/apache/tomcat/tomcat-jni/9.0.27/tomcat-jni-9.0.27.jar.asc(SHA1: ba4a536b4aba576ac99f2f4fe216e71bcb576ae1)/org/apache/tomcat/tomcat-jni/9.0.27/tomcat-jni-9.0.27-sources.jar.asc(SHA1: 991d8296d1ff55918e1a6c9f5e53ffe7fbbe5007)/org/apache/tomcat/tomcat-jni/9.0.27/tomcat-jni-9.0.27.pom.asc(SHA1: 5367d5ee2976fa2ad4285d3f6f75ef345b33656a)/org/apache/tomcat/tomcat-juli/9.0.27/tomcat-juli-9.0.27.jar(SHA1: d5cfc73fe8de46d808f60b387e2f6200ffd187ab)/org/apache/tomcat/tomcat-juli/9.0.27/tomcat-juli-9.0.27.pom.asc(SHA1: 0eb8a5a4ecd6e38fa91746a1110e92c6c7da5859)/org/apache/tomcat/tomcat-juli/9.0.27/tomcat-juli-9.0.27.pom(SHA1: c6552d0ed9632bfb342d20132a636f6148e97cf3)/org/apache/tomcat/tomcat-juli/9.0.27/tomcat-juli-9.0.27.jar.asc(SHA1: d9fbab38581cc048ff8992bf6304861b9592b26d)/org/apache/tomcat/tomcat-juli/9.0.27/tomcat-juli-9.0.27-sources.jar.asc(SHA1: 0f3b321126e059511eb38e8dfb802e291ded1f45)/org/apache/tomcat/tomcat-juli/9.0.27/tomcat-juli-9.0.27-sources.jar(SHA1: 5128db32da88fb3343a9d08bcd560064ce9cf254)/org/apache/tomcat/tomcat-util/9.0.27/tomcat-util-9.0.27-sources.jar.asc(SHA1: 215df244ac4b8e20feb5af7511fd31b1f9a0edba)/org/apache/tomcat/tomcat-util/9.0.27/tomcat-util-9.0.27.pom(SHA1: 27c932716adc8d6bcb9541072aeed83b87330669)/org/apache/tomcat/tomcat-util/9.0.27/tomcat-util-9.0.27-sources.jar(SHA1: 243de97ead08d682978665b6b143b810e5f6836a)/org/apache/tomcat/tomcat-util/9.0.27/tomcat-util-9.0.27.pom.asc(SHA1: e1c48fc992a23eb0f2d58489cf0c5150b18eb82c)/org/apache/tomcat/tomcat-util/9.0.27/tomcat-util-9.0.27.jar(SHA1: d36170dfbfb580eff9bb9668eeb19aac266c7d39)/org/apache/tomcat/tomcat-util/9.0.27/tomcat-util-9.0.27.jar.asc(SHA1: 4401f423dff3016d36697c04fd5058208266d487)/org/apache/tomcat/tomcat-catalina/9.0.27/tomcat-catalina-9.0.27.pom(SHA1: 4f15a8fef4030dd66735492a07f3cd942aab2f1a)/org/apache/tomcat/tomcat-catalina/9.0.27/tomcat-catalina-9.0.27-sources.jar.asc(SHA1: 2edf830449af19a452b26e735d31412e4c7ff6b7)/org/apache/tomcat/tomcat-catalina/9.0.27/tomcat-catalina-9.0.27.pom.asc(SHA1: a44bc4a7ab5c438a22c9bb4145b656597ca4107e)/org/apache/tomcat/tomcat-catalina/9.0.27/tomcat-catalina-9.0.27.jar.asc(SHA1: 4de7fa2f005dab33f0cfee0d68dc37d2bb6de6eb)/org/apache/tomcat/tomcat-catalina/9.0.27/tomcat-catalina-9.0.27-sources.jar(SHA1: 1aff19ee878d841ab8cf70ad8dc62502fdcc2835)/org/apache/tomcat/tomcat-catalina/9.0.27/tomcat-catalina-9.0.27.jar(SHA1: 6712916e508a92af6e624728891cb5236c3a325f)/org/apache/tomcat/tomcat-i18n-fr/9.0.27/tomcat-i18n-fr-9.0.27.pom(SHA1: 9d951701b342f20a083d73f2adaeeaae1199c778)/org/apache/tomcat/tomcat-i18n-fr/9.0.27/tomcat-i18n-fr-9.0.27.jar(SHA1: 933a0d42d5887769f8a024b2b52234802e025c58)/org/apache/tomcat/tomcat-i18n-fr/9.0.27/tomcat-i18n-fr-9.0.27.pom.asc(SHA1: 2fb43c03d60c941f8fc8960654778848905a6eaa)/org/apache/tomcat/tomcat-i18n-fr/9.0.27/tomcat-i18n-fr-9.0.27.jar.asc(SHA1: efc3e6cec87f094a97094e6fbf03cfa703f6c832)/org/apache/tomcat/tomcat-i18n-cs/9.0.27/tomcat-i18n-cs-9.0.27.jar(SHA1: 83a2826f111ce2ea10bcfba5392b33640274aecb)/org/apache/tomcat/tomcat-i18n-cs/9.0.27/tomcat-i18n-cs-9.0.27.pom.asc(SHA1: 3e9205cfd26d66e1e610936473b9875f1c201f36)/org/apache/tomcat/tomcat-i18n-cs/9.0.27/tomcat-i18n-cs-9.0.27.pom(SHA1: f563274be478852db3cd3ebd6e2dba5518e2637f)/org/apache/tomcat/tomcat-i18n-cs/9.0.27/tomcat-i18n-cs-9.0.27.jar.asc(SHA1: d317a857c51770e82fdd0efb366ca95f1bea6d77)/org/apache/tomcat/tomcat-jdbc/9.0.27/tomcat-jdbc-9.0.27-sources.jar.asc(SHA1: 978e61f949be37851bf6387fe430e33e5265d5f7)/org/apache/tomcat/tomcat-jdbc/9.0.27/tomcat-jdbc-9.0.27-sources.jar(SHA1: 61f0a9539e6db4fb9fd267042f73eb267589485e)/org/apache/tomcat/tomcat-jdbc/9.0.27/tomcat-jdbc-9.0.27.pom.asc(SHA1: 189b0b8f4f55a4bce09540d99a5ea8f5be37dcf4)/org/apache/tomcat/tomcat-jdbc/9.0.27/tomcat-jdbc-9.0.27.jar.asc(SHA1: 66c1c84701de6843ed745bd3f4f702178af57977)/org/apache/tomcat/tomcat-jdbc/9.0.27/tomcat-jdbc-9.0.27.pom(SHA1: 

Re: [VOTE] Release Apache Tomcat 9.0.27

2019-10-11 Thread Mark Thomas
On 07/10/2019 12:51, Mark Thomas wrote:

> The proposed 9.0.27 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 9.0.27

Unit tests pass for NIO, NIO2 and APR/native with Tomcat Native 1.2.23
on Linux, Windows and MacOS.

Mark

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



[Bug 63835] Add support for Keep-Alive header

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

Michael Osipov  changed:

   What|Removed |Added

 CC||micha...@apache.org

--- Comment #1 from Michael Osipov  ---
Draft is here:
https://github.com/apache/tomcat/commit/6ff2233cbbd27c9c2c649208a21931e5f3e132a6

-- 
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 BZ-63835/8.5.x created (now 6ff2233)

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

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


  at 6ff2233  First draft

This branch includes the following new commits:

 new 6ff2233  First draft

The 1 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.



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



[tomcat] 01/01: First draft

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

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

commit 6ff2233cbbd27c9c2c649208a21931e5f3e132a6
Author: Michael Osipov 
AuthorDate: Fri Oct 11 10:30:08 2019 +0200

First draft
---
 java/org/apache/coyote/http11/Http11Processor.java | 36 ++
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 6072602..3182bb7 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -23,6 +23,7 @@ import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 import java.util.regex.Pattern;
 
 import javax.servlet.http.HttpServletResponse;
@@ -1307,7 +1308,7 @@ public class Http11Processor extends AbstractProcessor {
 } else {
 // If the response code supports an entity body and we're on
 // HTTP 1.1 then we chunk unless we have a Connection: close header
-connectionClosePresent = isConnectionClose(headers);
+connectionClosePresent = isConnectionValue(headers, 
Constants.CLOSE);
 if (entityBody && http11 && !connectionClosePresent) {
 outputBuffer.addActiveFilter
 (outputFilters[Constants.CHUNKED_FILTER]);
@@ -1369,10 +1370,33 @@ public class Http11Processor extends AbstractProcessor {
 headers.addValue(Constants.CONNECTION).setString(
 Constants.CLOSE);
 }
-} else if (!http11 && !getErrorState().isError()) {
-
headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
-}
+} else if (!getErrorState().isError()) {
+if (!http11) {
+
headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
+}
+
+boolean connectionKeepAlivePresent =
+isConnectionValue(request.getMimeHeaders(), 
Constants.KEEPALIVE);
+
+if (connectionKeepAlivePresent) {
+int keepAliveTimeout = endpoint.getKeepAliveTimeout();
+int maxKeepAliveRequests = getMaxKeepAliveRequests();
+
+if (keepAliveTimeout > 0) {
+String value = "timeout=" + 
TimeUnit.MILLISECONDS.toSeconds(keepAliveTimeout);
+
+if (maxKeepAliveRequests > 0) {
+value += ", max=" + maxKeepAliveRequests;
+}
 
+headers.setValue("Keep-Alive").setString(value);
+}
+
+if (http11) {
+
headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE);
+}
+}
+}
 // Add server header
 if (server == null) {
 if (serverRemoveAppProvidedValues) {
@@ -1403,12 +1427,12 @@ public class Http11Processor extends AbstractProcessor {
 outputBuffer.commit();
 }
 
-private static boolean isConnectionClose(MimeHeaders headers) {
+private static boolean isConnectionValue(MimeHeaders headers, String 
value) {
 MessageBytes connection = headers.getValue(Constants.CONNECTION);
 if (connection == null) {
 return false;
 }
-return connection.equals(Constants.CLOSE);
+return connection.equals(value);
 }
 
 private void prepareSendfile(OutputFilter[] outputFilters) {


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



[Bug 63835] New: Add support for Keep-Alive header

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

Bug ID: 63835
   Summary: Add support for Keep-Alive header
   Product: Tomcat 8
   Version: 8.5.x-trunk
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Connectors
  Assignee: dev@tomcat.apache.org
  Reporter: micha...@apache.org
  Target Milestone: 

There were numerous question on SO and Google in the past years why Tomcat does
not send "Keep-Alive: timeout=X, max=Y" just like HTTPd does. Though
https://tools.ietf.org/html/draft-thomson-hybi-http-timeout-03 never made it in
to an RFC, a lot of clients read that timeout (like our Apache HttpClient) and
configure its connection pool or are simply unable to detect terminated
connection as described in RFC 7230 and need appropriate hints like this.

I have hit this with a client from a colleague written in C#, actually using a
WebServiceClient from .NET. No option to configure details like this.

Adding this header is quite easy since we can take the HTTPd code as a sample:
https://github.com/apache/httpd/blob/2.4.x/modules/http/http_protocol.c#L217-L299

I have a prototype implementation ready. If this is accepted I am willing to
polish and add appropriate tests for it. I don't see any downsides adding this.

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