Skip to content

Bump to latest grpc version#5299

Closed
devinrsmith wants to merge 1 commit intodeephaven:mainfrom
devinrsmith:bump-grpc-version
Closed

Bump to latest grpc version#5299
devinrsmith wants to merge 1 commit intodeephaven:mainfrom
devinrsmith:bump-grpc-version

Conversation

@devinrsmith
Copy link
Copy Markdown
Member

This is ostensibly for CVE-2023-44487.

Note: the netty-tcnative-boringssl-static version does not need to be updated for this.

This is ostensibly for CVE-2023-44487.

Note: the netty-tcnative-boringssl-static version does not need to be updated for this.
@devinrsmith
Copy link
Copy Markdown
Member Author

Note: I did some manual editting of io.grpc.* impls, along with what seemed like correct behavior. I'm not sure exactly the delta we want / need between our versions and grpc proper versions. Colin, do we still needs to maintain these layers?

@niloc132
Copy link
Copy Markdown
Member

Yes, by the time grpc-java landed our changes, our impl had drifted, and we haven't taken the time to propose api changes back to them again. I'll go over the remaining changes in our grpc-java/ dir and see about applying them to this.

Copy link
Copy Markdown
Member

@niloc132 niloc132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should revert some of these code changes around flush, see comments in the review.

I'll propose one commit for that (after any discussion), and then also port other changes from upstream - looks like we could use a logging change (minor perf improvement), a dependency cleanup, and a possible data race.

Comment on lines +88 to +90
if (flush && websocketSession.getBasicRemote().getBatchingAllowed()) {
websocketSession.getBasicRemote().flushBatch();
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically correct, but will never execute - we never setBatchingAllowed(true), so this will never run.

try {
// send in two separate payloads
websocketSession.getBasicRemote().sendBinary(prefix);
websocketSession.getBasicRemote().sendBinary(prefix, false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to do this - this means that the client can't begin to parse the message until the whole thing is sent. Technically it sort of does this anyway, but the client is implemented to buffer the partial messages it received.

This is unrelated to flushing anyway, and will not prevent flushing. Instead a websocket Binary Data frame will be sent after calling this with fin=false, rather than deferring sending at all (also called a "fragmented message").

} catch (IllegalStateException | IOException e) {
logger.log(WARNING, String.format("[{%s}] Exception when flushBuffer", logId), e);
cancel(Status.fromThrowable(e));
if (flush) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing grpc/grpc-java@8c05455 which introduced this API change, this is the opposite of what we need (not that we have the direct capability to control it here, at a glance): the bug being fixed is that the default is presumed to be to flush headers when this method was called, and the change is to say "actually, for unary (or client-streaming), suppress flushing when writing headers, wait until the first/only payload".

Upstream does not add any extra flush code here, and we shouldn't either - the goal isn't to say "ensure you flush right now when flush=true", but "if flush=false, ensure you don't flush".

@niloc132
Copy link
Copy Markdown
Member

niloc132 commented Jul 9, 2024

Advice from @devinrsmith, while updating other versions:

I see grpc-servlet-jakarta has compileOnly 'org.apache.tomcat:annotations-api:6.0.53'

@niloc132
Copy link
Copy Markdown
Member

niloc132 commented Nov 8, 2024

Superseded by #6301.

@niloc132 niloc132 closed this Nov 8, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants