From 9f5a8d097d776a9de8eface7133b47cafa3e6fc5 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 2 Nov 2023 07:59:43 +1100 Subject: [PATCH 1/2] use proper start/stop lifecycle on scanner Signed-off-by: Lachlan Roberts --- .../tools/development/jetty/JettyContainerService.java | 2 +- .../development/jetty/ee10/JettyContainerService.java | 2 +- .../tools/development/jetty9/JettyContainerService.java | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/runtime/local_jetty12/src/main/java/com/google/appengine/tools/development/jetty/JettyContainerService.java b/runtime/local_jetty12/src/main/java/com/google/appengine/tools/development/jetty/JettyContainerService.java index 69cc0670..b745b9b9 100644 --- a/runtime/local_jetty12/src/main/java/com/google/appengine/tools/development/jetty/JettyContainerService.java +++ b/runtime/local_jetty12/src/main/java/com/google/appengine/tools/development/jetty/JettyContainerService.java @@ -443,7 +443,7 @@ public boolean accept(File dir, String name) { } }); scanner.addListener(new ScannerListener()); - scanner.doStart(); + scanner.start(); } @Override diff --git a/runtime/local_jetty12_ee10/src/main/java/com/google/appengine/tools/development/jetty/ee10/JettyContainerService.java b/runtime/local_jetty12_ee10/src/main/java/com/google/appengine/tools/development/jetty/ee10/JettyContainerService.java index 39f8649f..38660b73 100644 --- a/runtime/local_jetty12_ee10/src/main/java/com/google/appengine/tools/development/jetty/ee10/JettyContainerService.java +++ b/runtime/local_jetty12_ee10/src/main/java/com/google/appengine/tools/development/jetty/ee10/JettyContainerService.java @@ -447,7 +447,7 @@ public boolean accept(File dir, String name) { } }); scanner.addListener(new ScannerListener()); - scanner.doStart(); + scanner.start(); } @Override diff --git a/runtime/local_jetty9/src/main/java/com/google/appengine/tools/development/jetty9/JettyContainerService.java b/runtime/local_jetty9/src/main/java/com/google/appengine/tools/development/jetty9/JettyContainerService.java index 141084d4..9a0176da 100644 --- a/runtime/local_jetty9/src/main/java/com/google/appengine/tools/development/jetty9/JettyContainerService.java +++ b/runtime/local_jetty9/src/main/java/com/google/appengine/tools/development/jetty9/JettyContainerService.java @@ -69,6 +69,7 @@ import org.eclipse.jetty.server.nio.NetworkTrafficSelectChannelConnector; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.Scanner; +import org.eclipse.jetty.util.component.LifeCycle; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppContext; @@ -420,7 +421,7 @@ public boolean accept(File dir, String name) { } }); scanner.addListener(new ScannerListener()); - scanner.doStart(); + scanner.start(); } @Override @@ -463,7 +464,7 @@ private File getScanTarget() throws Exception { } } - private void fullWebAppScanner(int interval) throws IOException { + private void fullWebAppScanner(int interval) throws Exception { String webInf = context.getWebInf().getFile().getPath(); List scanList = new ArrayList<>(); Collections.addAll( @@ -488,7 +489,7 @@ public void filesChanged(List changedFiles) throws Exception { } }); - scanner.doStart(); + scanner.start(); } /** From 1708b7a2a604a1a7cea16ce6da0e780d725a8044 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Wed, 8 Nov 2023 20:11:07 +1100 Subject: [PATCH 2/2] Issue #72 - add fix and TODOs for ParseBlobUploadFilter Signed-off-by: Lachlan Roberts --- .../apphosting/runtime/jetty/ee10/AppEngineWebAppContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/ee10/AppEngineWebAppContext.java b/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/ee10/AppEngineWebAppContext.java index 42d4b475..9e7a2634 100644 --- a/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/ee10/AppEngineWebAppContext.java +++ b/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/ee10/AppEngineWebAppContext.java @@ -167,7 +167,8 @@ public AppEngineWebAppContext(File appDir, String serverInfo, boolean extractWar setMaxFormContentSize(MAX_RESPONSE_SIZE); - addFilter(new ParseBlobUploadFilter(), "/*", EnumSet.allOf(DispatcherType.class)); + // TODO: Can we change to a jetty-core handler? what to do on ASYNC? + addFilter(new ParseBlobUploadFilter(), "/*", EnumSet.of(DispatcherType.REQUEST)); ignoreContentLength = isAppIdForNonContentLength(); }