Skip to content

Commit 764e2f0

Browse files
chore(implementation)!: use Jetty-12 core without servlets
Port the invoker to upgrade to Eclipse Jetty-12 version 12. Specifically using the new core APIs of Eclipse Jetty-12 that allow the overhead of a Servlet container to be avoided. BREAKING CHANGE: use Java 17 or above, as required by Eclipse Jetty-12. Signed-off-by: Lachlan Roberts <[email protected]>
1 parent 712daf1 commit 764e2f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

invoker/core/src/main/java/com/google/cloud/functions/invoker/http/TimeoutHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
package com.google.cloud.functions.invoker.http;
1616

1717
import java.time.Duration;
18-
import java.util.concurrent.TimeoutException;
1918
import java.util.concurrent.atomic.AtomicBoolean;
19+
import org.eclipse.jetty.http.BadMessageException;
20+
import org.eclipse.jetty.http.HttpStatus;
2021
import org.eclipse.jetty.server.Handler;
2122
import org.eclipse.jetty.server.Request;
2223
import org.eclipse.jetty.server.Response;
@@ -41,7 +42,7 @@ public boolean handle(Request request, Response response, Callback callback) thr
4142
.getComponents()
4243
.getScheduler()
4344
.schedule(
44-
() -> wrappedCallback.failed(new TimeoutException("Function execution timed out")),
45+
() -> wrappedCallback.failed(new BadMessageException(HttpStatus.REQUEST_TIMEOUT_408, "Function execution timed out")),
4546
timeout);
4647

4748
// Cancel the timeout if the request completes the callback first.

0 commit comments

Comments
 (0)