From f9e1e571533f092fe496bb48fcb0ca3cb2f4cbc3 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 21 Mar 2024 09:23:51 +1100 Subject: [PATCH] add option to do a Jetty server dump to help with debug Signed-off-by: Lachlan Roberts --- .../apphosting/runtime/jetty/AppVersionHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/AppVersionHandler.java b/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/AppVersionHandler.java index 2ea7b7b6..43110a69 100644 --- a/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/AppVersionHandler.java +++ b/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/AppVersionHandler.java @@ -20,11 +20,12 @@ import com.google.apphosting.runtime.AppVersion; import com.google.apphosting.runtime.SessionStore; import com.google.apphosting.runtime.SessionStoreFactory; -import java.util.Objects; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.handler.HotSwapHandler; import org.eclipse.jetty.session.SessionManager; +import java.util.Objects; + /** * {@code AppVersionHandlerMap} is a {@code HandlerContainer} that identifies each child {@code * Handler} with a particular {@code AppVersionKey}. @@ -37,7 +38,6 @@ public class AppVersionHandler extends HotSwapHandler { private final AppVersionHandlerFactory appVersionHandlerFactory; private AppVersion appVersion; - private org.eclipse.jetty.server.Handler handler; public AppVersionHandler(AppVersionHandlerFactory appVersionHandlerFactory) { this.appVersionHandlerFactory = appVersionHandlerFactory; @@ -78,6 +78,10 @@ public synchronized boolean ensureHandler(AppVersionKey appVersionKey) throws Ex if (handler == null) { handler = appVersionHandlerFactory.createHandler(appVersion); setHandler(handler); + + if (Boolean.getBoolean("jetty.server.dumpAfterStart")) { + handler.getServer().dumpStdErr(); + } } return (handler != null); }