Skip to content

Commit

Permalink
add option to do a Jetty server dump to help with debug
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed Mar 20, 2024
1 parent 196a354 commit f9e1e57
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit f9e1e57

Please sign in to comment.