Re: h2 priorities
On 07/08/2019 17:42, Mark Thomas wrote: > Just a quick update. > > I started to make some progress but I have been side-tracked by the > HTTP/2 timeout issue raised on users. I've been able to get the clean-up > in but the priority changes aren't going to make the next set of releases. With the HTTP/2 timeout issue resolved, I thought I'd take a quick look at this again in case I could make progress. I had some success in that the test at https://ishttp2fastyet.com shows some improvements with my priority changes but there are some issues: 1. The HTTP/2 unit tests are ~50% slower. This looks to be a small number timing out. I suspect a timing issue in the patch. 2. I haven't looked at how to handle non-blocking I/O 3. Ignoring the 2 issues above, the patch shows some clear improvement. However, the result is far from the ideal. The root cause is Tomcat does not prioritize HTTP/2 reads over HTTP/2 writes and it really needs to for prioritisation to work as intended. I'm planning on switching focus for the priority work and will look at mechanisms for prioritizing HTTP/2 reads. Mark > On 01/08/2019 09:19, Mark Thomas wrote: >> My general thinking is some sort of priority manager where multiple >> implementations are available. Something like: >> - NO-OP (current behaviour) >> - dependencies only (takes account of dependencies for write >> ordering but not weights >> - full (takes account of dependencies and weights for write ordering) >> >> I'm not sure the 'full' implementation is viable for a Servlet >> container. What is doable for a single thread managing the writes for >> multiple static resources gets a lot more complicated when you have one >> thread per resource generating those resources dynamically. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] jzinkweg opened a new pull request #187: Prevent NullPointerException in CrawlerSessionManagerValve
jzinkweg opened a new pull request #187: Prevent NullPointerException in CrawlerSessionManagerValve URL: https://github.com/apache/tomcat/pull/187 https://bz.apache.org/bugzilla/show_bug.cgi?id=62297 made the CrawlerSessionManagerValve context-aware but the new code does not handle the scenario where requests do not match _any_ application context. This occurs when there is no application deployed on the ROOT context and the request is outside the context root of the deployed applications. ``` 2019-08-09 13:55:49.125 SEVERE [http-nio-0.0.0.0-10099-exec-3] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.catalina.valves.CrawlerSessionManagerValve.getClientIdentifier(CrawlerSessionManagerValve.java:267) at org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(CrawlerSessionManagerValve.java:181) at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679) at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:348) at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:53) at org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:206) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1747) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) ``` nb: this also applies to Tomcat 7/8/8.5 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [tomcat] 02/02: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mark, On 8/8/19 08:19, ma...@apache.org wrote: > This is an automated email from the ASF dual-hosted git > repository. > > markt pushed a commit to branch master in repository > https://gitbox.apache.org/repos/asf/tomcat.git > > commit 7ac5fc8a59c10e7de1ee6d4b85c1ee797942a1e7 Author: Mark Thomas > AuthorDate: Thu Aug 8 13:17:29 2019 +0100 > > Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285 > > Align the behaviour of service.bat with the Windows installer and > rename the executables on installation (and restore on removal). If I understand this patch, I might need to veto it for Tomcat 9. Changing for TC 10 will be okay. Re-naming the Tomcat .exe files on Windows will be a very surprising change for a point-release. Every installation I've ever worked on has multiple services running off the same Tomcat installation. If any of them is upgraded without adding the "--no-rename" option to an invocation of the service.bat script, all automation will begin to fail. That includes services which *are not* reconfigured because the TomcatX.exe file will be renamed and still referenced in various service definitions. Thanks, - -chris > --- bin/service.bat| 110 > ++--- webapps/docs/changelog.xml > | 9 +++ webapps/docs/windows-service-howto.xml | 14 - 3 > files changed, 94 insertions(+), 39 deletions(-) > > diff --git a/bin/service.bat b/bin/service.bat index > 5d9e053..6105b15 100755 --- a/bin/service.bat +++ > b/bin/service.bat @@ -17,7 +17,7 @@ rem limitations under the > License. rem > -- - - > > rem NT Service Install/Uninstall script > rem -rem Usage: service.bat install/remove [service_name] [/user > username] +rem Usage: service.bat install/remove [service_name > [--no-rename]] [--user username] rem rem Options rem install > Install the service using default settings. @@ -26,7 +26,10 @@ rem > rem service_name (optional) The name to use for the service. If not > specified, rem Tomcat@VERSION_MAJOR@ is > used as the service name. rem -rem username (optional) The name > of the OS user to use to install/remove +rem --no-rename > (optional) Don't rename tomcat@VERSION_MAJOR@.exe and > tomcat@version_ma...@w.exe to match +rem > the non-default service name. +rem +rem username (optional) The > name of the OS user to use to install/remove rem > the service (not the name of the OS user the rem > service will run as). If not specified, the current rem > user is used. @@ -35,21 +38,70 @@ rem > -- - - > > setlocal > > set "SELF=%~dp0%service.bat" -rem Guess CATALINA_HOME if not > defined + +set DEFAULT_SERVICE_NAME=Tomcat@VERSION_MAJOR@ +set > SERVICE_NAME=%DEFAULT_SERVICE_NAME% + set "CURRENT_DIR=%cd%" + +rem > Parse the arguments +if "x%1x" == "xx" goto displayUsage +set > SERVICE_CMD=%1 +shift +if "x%1x" == "xx" goto checkEnv +:checkUser > +if "x%1x" == "x/userx" goto runAsUser +if "x%1x" == "x--userx" > goto runAsUser +set SERVICE_NAME=%1 +shift +if "x%1x" == "xx" goto > checkEnv +if "x%1x" == "x--no-renamex" ( +set NO_RENAME=%1 + > shift +) +if "x%1x" == "xx" goto checkEnv +goto checkUser > +:runAsUser +shift +if "x%1x" == "xx" goto displayUsage +set > SERVICE_USER=%1 +shift +runas /env /savecred /user:%SERVICE_USER% > "%COMSPEC% /K \"%SELF%\" %SERVICE_CMD% %SERVICE_NAME%" +goto end + > +rem Check the environment +:checkEnv + +rem Guess CATALINA_HOME if > not defined if not "%CATALINA_HOME%" == "" goto gotHome set > "CATALINA_HOME=%cd%" -if exist > "%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe" goto okHome +if > exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" goto okHome > +if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" goto okHome rem > CD to the upper dir cd .. set "CATALINA_HOME=%cd%" :gotHome -if > exist "%CATALINA_HOME%\bin\tomcat@VERSION_MAJOR@.exe" goto okHome > -echo The tomcat@VERSION_MAJOR@.exe was not found... -echo The > CATALINA_HOME environment variable is not defined correctly. -echo > This environment variable is needed to run this program +if exist > "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" ( +set > "EXECUTABLE=%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" + > goto okHome +) +if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" > ( +set "EXECUTABLE=%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" + > goto okHome +) +if "%DEFAULT_SERVICE_NAME%"== "%SERVICE_NAME%" ( + > echo The file %DEFAULT_SERVICE_NAME%.exe was not found... +) else > ( +echo Neither the %DEFAULT_SERVICE_NAME%.exe file nor the > %SERVICE_NAME%.exe file was found... +) +echo Either the > CATALINA_HOME environment variable is not defined correctly or > +echo the incorrect service name has been used. +echo Both the > CATALINA_HOME environment variable and the correct service name > +echo are required to
Re: [tomcat] 02/02: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285
> Mark, > > On 8/8/19 08:19, ma...@apache.org wrote: >> This is an automated email from the ASF dual-hosted git >> repository. > >> markt pushed a commit to branch master in repository >> https://gitbox.apache.org/repos/asf/tomcat.git > >> commit 7ac5fc8a59c10e7de1ee6d4b85c1ee797942a1e7 Author: Mark Thomas >> AuthorDate: Thu Aug 8 13:17:29 2019 +0100 > >> Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285 > >> Align the behaviour of service.bat with the Windows installer and >> rename the executables on installation (and restore on removal). > > If I understand this patch, I might need to veto it for Tomcat 9. > Changing for TC 10 will be okay. > > Re-naming the Tomcat .exe files on Windows will be a very surprising > change for a point-release. Every installation I've ever worked on has > multiple services running off the same Tomcat installation. If any of > them is upgraded without adding the "--no-rename" option to an > invocation of the service.bat script, all automation will begin to > fail. As soon as a new service is installed, yes. > That includes services which *are not* reconfigured because the > TomcatX.exe file will be renamed and still referenced in various > service definitions. Yes. This is one of those cases where something is going to be broken whatever we do. Happy to discuss options to try and minimise how much gets broken. How about this as a modified approach: - Keep renaming back to Tomcat9[w].exe on remove. That won't impact existing service.bat users but will help users that install via the installer (e.g. they'll be able to change the service name). - Change the option to --rename and only rename on install when explicitly requested. Current service.bat users would be unaffected and installer users would need to use this option if they used service.bat to uninstall and reinstall the service (e.g. to rename it) That should fix the reported issue while removing the impact on the existing service.bat users. Thoughts? Mark P.S. I know the 9.0.x and 8.5.x tags are overdue but I'd rather wait a few more days to make sure we are happy with this change before tagging and committing us to an approach. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] markt-asf closed pull request #187: Prevent NullPointerException in CrawlerSessionManagerValve
markt-asf closed pull request #187: Prevent NullPointerException in CrawlerSessionManagerValve URL: https://github.com/apache/tomcat/pull/187 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 8.5.x updated: Fix https://github.com/apache/tomcat/pull/187 Avoid NPE
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 b52978a Fix https://github.com/apache/tomcat/pull/187 Avoid NPE b52978a is described below commit b52978a793f7ab52651c1b816dd6f57ea8d366ed Author: Mark Thomas AuthorDate: Fri Aug 9 15:17:06 2019 +0100 Fix https://github.com/apache/tomcat/pull/187 Avoid NPE Avoid a NullPointerException in the CrawlerSessionManagerValve if no ROOT Context is deployed and a request does not map to any of the other deployed Contexts. Patch provided by Jop Zinkweg. --- .../valves/CrawlerSessionManagerValve.java | 2 +- .../valves/TestCrawlerSessionManagerValve.java | 41 ++ webapps/docs/changelog.xml | 6 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java index 1bef60c..439afa6 100644 --- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java +++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java @@ -265,7 +265,7 @@ public class CrawlerSessionManagerValve extends ValveBase { if (isHostAware) { result.append('-').append(host.getName()); } -if (isContextAware) { +if (isContextAware && context != null) { result.append(context.getName()); } return result.toString(); diff --git a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java index ec783d8..631c979 100644 --- a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java +++ b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java @@ -98,6 +98,18 @@ public class TestCrawlerSessionManagerValve { } @Test +public void testCrawlerMultipleContextsContextAware() throws Exception { +CrawlerSessionManagerValve valve = new CrawlerSessionManagerValve(); +valve.setCrawlerUserAgents(valve.getCrawlerUserAgents()); +valve.setHostAware(true); +valve.setContextAware(true); +valve.setNext(EasyMock.createMock(Valve.class)); + +verifyCrawlingContext(valve, "/examples"); +verifyCrawlingContext(valve, null); +} + +@Test public void testCrawlersSessionIdIsRemovedAfterSessionExpiry() throws IOException, ServletException { CrawlerSessionManagerValve valve = new CrawlerSessionManagerValve(); valve.setCrawlerIps("216\\.58\\.206\\.174"); @@ -127,7 +139,20 @@ public class TestCrawlerSessionManagerValve { private void verifyCrawlingLocalhost(CrawlerSessionManagerValve valve, String hostname) throws IOException, ServletException { HttpSession session = createSessionExpectations(valve, true); -Request request = createRequestExpectations("127.0.0.1", session, true, hostname, "tomcatBot 1.0"); +Request request = createRequestExpectations("127.0.0.1", session, true, hostname, "/examples", "tomcatBot 1.0"); + +EasyMock.replay(request, session); + +valve.invoke(request, EasyMock.createMock(Response.class)); + +EasyMock.verify(request, session); +} + + +private void verifyCrawlingContext(CrawlerSessionManagerValve valve, String contextPath) +throws IOException, ServletException { +HttpSession session = createSessionExpectations(valve, true); +Request request = createRequestExpectations("127.0.0.1", session, true, "localhost", contextPath, "tomcatBot 1.0"); EasyMock.replay(request, session); @@ -151,14 +176,15 @@ public class TestCrawlerSessionManagerValve { private Request createRequestExpectations(String ip, HttpSession session, boolean isBot) { -return createRequestExpectations(ip, session, isBot, "localhost", "something 1.0"); +return createRequestExpectations(ip, session, isBot, "localhost", "/examples", "something 1.0"); } -private Request createRequestExpectations(String ip, HttpSession session, boolean isBot, String hostname, String userAgent) { +private Request createRequestExpectations(String ip, HttpSession session, boolean isBot, String hostname, +String contextPath, String userAgent) { Request request = EasyMock.createMock(Request.class); EasyMock.expect(request.getRemoteAddr()).andReturn(ip); EasyMock.expect(request.getHost()).andReturn(simpleHostWithName(hostname)); - EasyMock.expect(request.getContext()).andReturn(simpleContextWithName()); + EasyMock.expect(request.getContext()).andReturn(simpleContextWithName(contextPath)); IExpectationSetters setter = EasyMock.expect(request.getSessio
[tomcat] branch master updated: Fix https://github.com/apache/tomcat/pull/187 Avoid NPE
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 6d6e1c4 Fix https://github.com/apache/tomcat/pull/187 Avoid NPE 6d6e1c4 is described below commit 6d6e1c4c7a51e1db61cdd6ef52ef73bb7158f5af Author: Mark Thomas AuthorDate: Fri Aug 9 15:17:06 2019 +0100 Fix https://github.com/apache/tomcat/pull/187 Avoid NPE Avoid a NullPointerException in the CrawlerSessionManagerValve if no ROOT Context is deployed and a request does not map to any of the other deployed Contexts. Patch provided by Jop Zinkweg. --- .../valves/CrawlerSessionManagerValve.java | 2 +- .../valves/TestCrawlerSessionManagerValve.java | 41 ++ webapps/docs/changelog.xml | 6 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java index 0a7968d..da01da8 100644 --- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java +++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java @@ -265,7 +265,7 @@ public class CrawlerSessionManagerValve extends ValveBase { if (isHostAware) { result.append('-').append(host.getName()); } -if (isContextAware) { +if (isContextAware && context != null) { result.append(context.getName()); } return result.toString(); diff --git a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java index 2055402..56d07b8 100644 --- a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java +++ b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java @@ -98,6 +98,18 @@ public class TestCrawlerSessionManagerValve { } @Test +public void testCrawlerMultipleContextsContextAware() throws Exception { +CrawlerSessionManagerValve valve = new CrawlerSessionManagerValve(); +valve.setCrawlerUserAgents(valve.getCrawlerUserAgents()); +valve.setHostAware(true); +valve.setContextAware(true); +valve.setNext(EasyMock.createMock(Valve.class)); + +verifyCrawlingContext(valve, "/examples"); +verifyCrawlingContext(valve, null); +} + +@Test public void testCrawlersSessionIdIsRemovedAfterSessionExpiry() throws IOException, ServletException { CrawlerSessionManagerValve valve = new CrawlerSessionManagerValve(); valve.setCrawlerIps("216\\.58\\.206\\.174"); @@ -127,7 +139,20 @@ public class TestCrawlerSessionManagerValve { private void verifyCrawlingLocalhost(CrawlerSessionManagerValve valve, String hostname) throws IOException, ServletException { HttpSession session = createSessionExpectations(valve, true); -Request request = createRequestExpectations("127.0.0.1", session, true, hostname, "tomcatBot 1.0"); +Request request = createRequestExpectations("127.0.0.1", session, true, hostname, "/examples", "tomcatBot 1.0"); + +EasyMock.replay(request, session); + +valve.invoke(request, EasyMock.createMock(Response.class)); + +EasyMock.verify(request, session); +} + + +private void verifyCrawlingContext(CrawlerSessionManagerValve valve, String contextPath) +throws IOException, ServletException { +HttpSession session = createSessionExpectations(valve, true); +Request request = createRequestExpectations("127.0.0.1", session, true, "localhost", contextPath, "tomcatBot 1.0"); EasyMock.replay(request, session); @@ -151,14 +176,15 @@ public class TestCrawlerSessionManagerValve { private Request createRequestExpectations(String ip, HttpSession session, boolean isBot) { -return createRequestExpectations(ip, session, isBot, "localhost", "something 1.0"); +return createRequestExpectations(ip, session, isBot, "localhost", "/examples", "something 1.0"); } -private Request createRequestExpectations(String ip, HttpSession session, boolean isBot, String hostname, String userAgent) { +private Request createRequestExpectations(String ip, HttpSession session, boolean isBot, String hostname, +String contextPath, String userAgent) { Request request = EasyMock.createMock(Request.class); EasyMock.expect(request.getRemoteAddr()).andReturn(ip); EasyMock.expect(request.getHost()).andReturn(simpleHostWithName(hostname)); - EasyMock.expect(request.getContext()).andReturn(simpleContextWithName()); + EasyMock.expect(request.getContext()).andReturn(simpleContextWithName(contextPath)); IExpectationSetters setter = EasyMock.expect(request.getSess
[tomcat] 02/02: Fix https://github.com/apache/tomcat/pull/187 Avoid NPE
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 8539fc8a8bebc52c513313f07403abb1dde92037 Author: Mark Thomas AuthorDate: Fri Aug 9 15:17:06 2019 +0100 Fix https://github.com/apache/tomcat/pull/187 Avoid NPE Avoid a NullPointerException in the CrawlerSessionManagerValve if no ROOT Context is deployed and a request does not map to any of the other deployed Contexts. Patch provided by Jop Zinkweg. --- .../valves/CrawlerSessionManagerValve.java | 2 +- .../valves/TestCrawlerSessionManagerValve.java | 41 ++ webapps/docs/changelog.xml | 6 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java index 773ef09..597aa98 100644 --- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java +++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java @@ -265,7 +265,7 @@ public class CrawlerSessionManagerValve extends ValveBase { if (isHostAware) { result.append('-').append(host.getName()); } -if (isContextAware) { +if (isContextAware && context != null) { result.append(context.getName()); } return result.toString(); diff --git a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java index 86a86b5..a6eda04 100644 --- a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java +++ b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java @@ -98,6 +98,18 @@ public class TestCrawlerSessionManagerValve { } @Test +public void testCrawlerMultipleContextsContextAware() throws Exception { +CrawlerSessionManagerValve valve = new CrawlerSessionManagerValve(); +valve.setCrawlerUserAgents(valve.getCrawlerUserAgents()); +valve.setHostAware(true); +valve.setContextAware(true); +valve.setNext(EasyMock.createMock(Valve.class)); + +verifyCrawlingContext(valve, "/examples"); +verifyCrawlingContext(valve, null); +} + +@Test public void testCrawlersSessionIdIsRemovedAfterSessionExpiry() throws IOException, ServletException { CrawlerSessionManagerValve valve = new CrawlerSessionManagerValve(); valve.setCrawlerIps("216\\.58\\.206\\.174"); @@ -127,7 +139,20 @@ public class TestCrawlerSessionManagerValve { private void verifyCrawlingLocalhost(CrawlerSessionManagerValve valve, String hostname) throws IOException, ServletException { HttpSession session = createSessionExpectations(valve, true); -Request request = createRequestExpectations("127.0.0.1", session, true, hostname, "tomcatBot 1.0"); +Request request = createRequestExpectations("127.0.0.1", session, true, hostname, "/examples", "tomcatBot 1.0"); + +EasyMock.replay(request, session); + +valve.invoke(request, EasyMock.createMock(Response.class)); + +EasyMock.verify(request, session); +} + + +private void verifyCrawlingContext(CrawlerSessionManagerValve valve, String contextPath) +throws IOException, ServletException { +HttpSession session = createSessionExpectations(valve, true); +Request request = createRequestExpectations("127.0.0.1", session, true, "localhost", contextPath, "tomcatBot 1.0"); EasyMock.replay(request, session); @@ -151,14 +176,15 @@ public class TestCrawlerSessionManagerValve { private Request createRequestExpectations(String ip, HttpSession session, boolean isBot) { -return createRequestExpectations(ip, session, isBot, "localhost", "something 1.0"); +return createRequestExpectations(ip, session, isBot, "localhost", "/examples", "something 1.0"); } -private Request createRequestExpectations(String ip, HttpSession session, boolean isBot, String hostname, String userAgent) { +private Request createRequestExpectations(String ip, HttpSession session, boolean isBot, String hostname, +String contextPath, String userAgent) { Request request = EasyMock.createMock(Request.class); EasyMock.expect(request.getRemoteAddr()).andReturn(ip); EasyMock.expect(request.getHost()).andReturn(simpleHostWithName(hostname)); - EasyMock.expect(request.getContext()).andReturn(simpleContextWithName()); + EasyMock.expect(request.getContext()).andReturn(simpleContextWithName(contextPath)); IExpectationSetters setter = EasyMock.expect(request.getSession(false)) .andReturn(null); if (isBot) { @@ -175,9 +201,12 @@ public class TestCrawlerSessionManagerValve { return host; } -pr
[tomcat] branch 7.0.x updated (659590c -> 8539fc8)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git. from 659590c Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285 new ca7002a No functional change. Align with 8.5.x. new 8539fc8 Fix https://github.com/apache/tomcat/pull/187 Avoid NPE The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../valves/CrawlerSessionManagerValve.java | 2 +- .../valves/TestCrawlerSessionManagerValve.java | 44 ++ webapps/docs/changelog.xml | 6 +++ 3 files changed, 43 insertions(+), 9 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 01/02: No functional change. Align with 8.5.x.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit ca7002a1821a6650a991a25aae3092d08d8485bf Author: Mark Thomas AuthorDate: Fri Aug 9 15:04:16 2019 +0100 No functional change. Align with 8.5.x. --- test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java index 30021fb..86a86b5 100644 --- a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java +++ b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java @@ -164,8 +164,7 @@ public class TestCrawlerSessionManagerValve { if (isBot) { setter.andReturn(session); } -EasyMock.expect(request.getHeaders("user-agent")) -.andReturn(Collections.enumeration(Arrays.asList(userAgent))); + EasyMock.expect(request.getHeaders("user-agent")).andReturn(Collections.enumeration(Arrays.asList(userAgent))); return request; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] markt-asf commented on issue #187: Prevent NullPointerException in CrawlerSessionManagerValve
markt-asf commented on issue #187: Prevent NullPointerException in CrawlerSessionManagerValve URL: https://github.com/apache/tomcat/pull/187#issuecomment-519937985 Thanks for the report and the patch. I applied it along with a test case that verified the issue and the fix. It has been back-ported to 8.5.x and 7.0.x. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch master updated: Merge additional fix for DBCP-555
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 9feda96 Merge additional fix for DBCP-555 9feda96 is described below commit 9feda96c60fd16db2cd3fe0f39df326b05c8c307 Author: Mark Thomas AuthorDate: Fri Aug 9 17:47:36 2019 +0100 Merge additional fix for DBCP-555 --- MERGE.txt | 2 +- java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java| 10 +- java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java | 10 +- .../apache/tomcat/dbcp/dbcp2/PoolableCallableStatement.java| 8 .../apache/tomcat/dbcp/dbcp2/PoolablePreparedStatement.java| 8 java/org/apache/tomcat/dbcp/dbcp2/SQLExceptionList.java| 8 +++- webapps/docs/changelog.xml | 2 +- 7 files changed, 27 insertions(+), 21 deletions(-) diff --git a/MERGE.txt b/MERGE.txt index 396405a..18da378 100644 --- a/MERGE.txt +++ b/MERGE.txt @@ -63,7 +63,7 @@ Sub-tree src/main/java/org/apache/commons/dbcp2 src/main/resources/org/apache/commons/dbcp2 The SHA1 ID for the most recent commit to be merged to Tomcat is: -87d9e3a66b896d81339a0947d001837ad2651605 (2019-08-01) +4813b7f5456c1f4fecc4f701ac731a71f57db249 (2019-08-09) Pool2 Sub-tree diff --git a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java index 21d77eb..b06546a 100644 --- a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java +++ b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java @@ -622,7 +622,7 @@ public class DelegatingConnection extends AbandonedTrace i // DBCP-288. Not all the traced objects will be statements final List traces = getTrace(); if (traces != null && traces.isEmpty()) { -final List thrown = new ArrayList<>(); +final List thrownList = new ArrayList<>(); final Iterator traceIter = traces.iterator(); while (traceIter.hasNext()) { final Object trace = traceIter.next(); @@ -630,7 +630,7 @@ public class DelegatingConnection extends AbandonedTrace i try { ((Statement) trace).close(); } catch (Exception e) { -thrown.add(e); +thrownList.add(e); } } else if (trace instanceof ResultSet) { // DBCP-265: Need to close the result sets that are @@ -638,13 +638,13 @@ public class DelegatingConnection extends AbandonedTrace i try { ((ResultSet) trace).close(); } catch (Exception e) { -thrown.add(e); +thrownList.add(e); } } } clearTrace(); -if (!thrown.isEmpty()) { -throw new SQLExceptionList(thrown); +if (!thrownList.isEmpty()) { +throw new SQLExceptionList(thrownList); } } setLastUsed(0); diff --git a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java index d4f9355..daa0c04 100644 --- a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java +++ b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java @@ -126,7 +126,7 @@ public class DelegatingStatement extends AbandonedTrace implements Statement { if (isClosed()) { return; } -final List thrown = new ArrayList<>(); +final List thrownList = new ArrayList<>(); try { if (connection != null) { connection.removeTrace(this); @@ -150,7 +150,7 @@ public class DelegatingStatement extends AbandonedTrace implements Statement { // Does not rethrow e. connection.handleExceptionNoThrow(e); } -thrown.add(e); +thrownList.add(e); } } clearTrace(); @@ -163,15 +163,15 @@ public class DelegatingStatement extends AbandonedTrace implements Statement { // Does not rethrow e. connection.handleExceptionNoThrow(e); } -thrown.add(e); +thrownList.add(e); } } } } finally { closed = true; statement = null; -if (!thrown.isEmpty()) { -throw new SQLExceptionList(thrown); +i
[tomcat] branch 8.5.x updated: Merge additional fix for DBCP-555
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 c3761d2 Merge additional fix for DBCP-555 c3761d2 is described below commit c3761d202b06121dd82d7632e0344f19d77038d2 Author: Mark Thomas AuthorDate: Fri Aug 9 17:47:36 2019 +0100 Merge additional fix for DBCP-555 --- MERGE.txt | 2 +- java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java| 10 +- java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java | 10 +- .../apache/tomcat/dbcp/dbcp2/PoolableCallableStatement.java| 8 .../apache/tomcat/dbcp/dbcp2/PoolablePreparedStatement.java| 8 java/org/apache/tomcat/dbcp/dbcp2/SQLExceptionList.java| 8 +++- webapps/docs/changelog.xml | 2 +- 7 files changed, 27 insertions(+), 21 deletions(-) diff --git a/MERGE.txt b/MERGE.txt index 396405a..18da378 100644 --- a/MERGE.txt +++ b/MERGE.txt @@ -63,7 +63,7 @@ Sub-tree src/main/java/org/apache/commons/dbcp2 src/main/resources/org/apache/commons/dbcp2 The SHA1 ID for the most recent commit to be merged to Tomcat is: -87d9e3a66b896d81339a0947d001837ad2651605 (2019-08-01) +4813b7f5456c1f4fecc4f701ac731a71f57db249 (2019-08-09) Pool2 Sub-tree diff --git a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java index 21d77eb..b06546a 100644 --- a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java +++ b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java @@ -622,7 +622,7 @@ public class DelegatingConnection extends AbandonedTrace i // DBCP-288. Not all the traced objects will be statements final List traces = getTrace(); if (traces != null && traces.isEmpty()) { -final List thrown = new ArrayList<>(); +final List thrownList = new ArrayList<>(); final Iterator traceIter = traces.iterator(); while (traceIter.hasNext()) { final Object trace = traceIter.next(); @@ -630,7 +630,7 @@ public class DelegatingConnection extends AbandonedTrace i try { ((Statement) trace).close(); } catch (Exception e) { -thrown.add(e); +thrownList.add(e); } } else if (trace instanceof ResultSet) { // DBCP-265: Need to close the result sets that are @@ -638,13 +638,13 @@ public class DelegatingConnection extends AbandonedTrace i try { ((ResultSet) trace).close(); } catch (Exception e) { -thrown.add(e); +thrownList.add(e); } } } clearTrace(); -if (!thrown.isEmpty()) { -throw new SQLExceptionList(thrown); +if (!thrownList.isEmpty()) { +throw new SQLExceptionList(thrownList); } } setLastUsed(0); diff --git a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java index 2537eae..52f9e26 100644 --- a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java +++ b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java @@ -126,7 +126,7 @@ public class DelegatingStatement extends AbandonedTrace implements Statement { if (isClosed()) { return; } -final List thrown = new ArrayList<>(); +final List thrownList = new ArrayList<>(); try { if (connection != null) { connection.removeTrace(this); @@ -150,7 +150,7 @@ public class DelegatingStatement extends AbandonedTrace implements Statement { // Does not rethrow e. connection.handleExceptionNoThrow(e); } -thrown.add(e); +thrownList.add(e); } } clearTrace(); @@ -163,15 +163,15 @@ public class DelegatingStatement extends AbandonedTrace implements Statement { // Does not rethrow e. connection.handleExceptionNoThrow(e); } -thrown.add(e); +thrownList.add(e); } } } } finally { closed = true; statement = null; -if (!thrown.isEmpty()) { -throw new SQLExceptionList(thrown); +if
[Bug 56724] Restart Container background thread if it died unexpectedly
https://bz.apache.org/bugzilla/show_bug.cgi?id=56724 Mark Thomas changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #5 from Mark Thomas --- Looking at the code for 9.0.x, 8.5.x and 7.0.x this looks to be complete and has been for a while. -- 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 62696] Consider use of sha256 for signing of .exe files of Tomcat installer.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62696 --- Comment #6 from Mark Thomas --- I've pinged DigiCert again on this. I'll post any update I receive. -- 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 58143] The WebppClassLoader doesn't call transformers on cached classes
https://bz.apache.org/bugzilla/show_bug.cgi?id=58143 Mark Thomas changed: What|Removed |Added Resolution|--- |FIXED Status|REOPENED|RESOLVED --- Comment #15 from Mark Thomas --- This was fixed in r1823460 -- 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] 02/02: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mark, On 8/9/19 09:46, Mark Thomas wrote: >> Mark, >> >> On 8/8/19 08:19, ma...@apache.org wrote: >>> This is an automated email from the ASF dual-hosted git >>> repository. >> >>> markt pushed a commit to branch master in repository >>> https://gitbox.apache.org/repos/asf/tomcat.git >> >>> commit 7ac5fc8a59c10e7de1ee6d4b85c1ee797942a1e7 Author: Mark >>> Thomas AuthorDate: Thu Aug 8 13:17:29 2019 >>> +0100 >> >>> Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63285 >> >>> Align the behaviour of service.bat with the Windows installer >>> and rename the executables on installation (and restore on >>> removal). >> >> If I understand this patch, I might need to veto it for Tomcat >> 9. Changing for TC 10 will be okay. >> >> Re-naming the Tomcat .exe files on Windows will be a very >> surprising change for a point-release. Every installation I've >> ever worked on has multiple services running off the same Tomcat >> installation. If any of them is upgraded without adding the >> "--no-rename" option to an invocation of the service.bat script, >> all automation will begin to fail. > > As soon as a new service is installed, yes. > >> That includes services which *are not* reconfigured because the >> TomcatX.exe file will be renamed and still referenced in various >> service definitions. > > Yes. > > This is one of those cases where something is going to be broken > whatever we do. Happy to discuss options to try and minimise how > much gets broken. Help me understand how "no change" is broken. Who is adversely affected by not making any changes? > How about this as a modified approach: > > - Keep renaming back to Tomcat9[w].exe on remove. That won't > impact existing service.bat users but will help users that install > via the installer (e.g. they'll be able to change the service > name). Aha. I'm sure that has something to do with the answer to "who is broken" question. > - Change the option to --rename and only rename on install when > explicitly requested. Current service.bat users would be > unaffected and installer users would need to use this option if > they used service.bat to uninstall and reinstall the service (e.g. > to rename it) I think I like the --no-rename -> --rename option is the best because it makes the smallest change. Only currently-affected users will need to modify their behavior, instead of most users having to modify their behavior. > That should fix the reported issue while removing the impact on > the existing service.bat users. > > Thoughts? > > Mark > > > P.S. I know the 9.0.x and 8.5.x tags are overdue but I'd rather > wait a few more days to make sure we are happy with this change > before tagging and committing us to an approach. +1 I wouldn't want to put out a release where the rules are different from every other release if we are going to change --no-rename -> - --rename. In case it's not clear, I'm fully in favor of changing --no-rename -> - --rename instead of the current patch. Thanks, - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl1Ns4MACgkQHPApP6U8 pFj6NA//ZkKtLWvNF3sByWLijbdtQlw8fTScLgWfrN2WmcJc5Y3gO+xfi89mfaPc 5We7o7F0pNmyYAF1ndyk4myKXju7tg6RPYEnfEm2sOv1UajOD7PIeFKC5WCnp4hn A6npiA4uXzDeEm8hTbdV9e1bIvZnx2xtivzD1tYvJpuctvjmb7ktK+hGw0SVNWxI zXept1kg4O8zHOp6XvGkcV7kCLitW9v0TeOwJmuIYUpjBB2J+wSnRNQZyZliUd+6 vQhrvGFzptcLE7j6ek24yKCRkCNXnBipoFnNT5GMBmjerd9w3QHvcrGefU4L1Zqk DgY1lDYaCBaAaBnPFMXPobmLhT/PbI6wVdl6s6b2sBk+fj9FZIS0bgVrb6hlBEVS GfBZPITR/HG+Bz1s4gLndNqbOZ1z/c7NpTM7smpcEnlaWSnjxQE/V90Kc4Y0cTXp +CudLWhxrqXFOEXuvngFCi1gXsvSbDqjMckcvgKfW764L1vOyNrWP4pgd/xSUJaq 0cq4q/Xw8Dhl3yBDxkG0ZLrvT9lNh9S4XKUW0WqXRSbiMmofAhSJS7bjEWnRS1sy nmxdG62EZyYaGs/8VUWz3eceUU3DqOgCtxO5nnfKC8h42bpSKJboQ1FvOO4dd5uV bkoQJrIkGopOzyGzxq5xHBVkJCxT9r/1+CRX0hJ31FNI6lJA1Bk= =02Pa -END PGP SIGNATURE- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 63579] o.a.catalina.webresources.StandardRoot.validate generates an IllegalArgumentException leading to a 500
https://bz.apache.org/bugzilla/show_bug.cgi?id=63579 Baji changed: What|Removed |Added URL||https://www.ap.gov.in/?page ||_id=39056 -- 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