Skip to content

Commit a16717f

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 61b5bef commit a16717f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,23 @@ public OutputStream getOutputStream() {
9696
false,
9797
outputBufferSize / 2,
9898
outputBufferSize);
99-
outputStream = new ContentSinkOutputStream(bufferedContentSink);
99+
100+
// TODO: remove override of close() when changes from
101+
// https://github.com/jetty/jetty.project/pull/13972 are released.
102+
outputStream =
103+
new ContentSinkOutputStream(bufferedContentSink) {
104+
boolean closed = false;
105+
106+
@Override
107+
public void close(Callback callback) throws IOException {
108+
if (closed) {
109+
callback.succeeded();
110+
}
111+
112+
closed = true;
113+
super.close(callback);
114+
}
115+
};
100116
}
101117
return outputStream;
102118
}

0 commit comments

Comments
 (0)