-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix builders ABI backward compatibility broken in v1.33.0 #7564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ejona86
reviewed
Oct 28, 2020
@sergiitk, did you push your changes? |
@ejona86 on it |
Confirming the latest change fixes server builders ABI. ❯ java -cp "./abi-1.32.2.jar:./deps-1.32.2/*" org.example.AbiServer
ServerImpl{logId=2, transportServers=[NettyServer{logId=1, address=0.0.0.0/0.0.0.0:10000}]}
❯ java -cp "./abi-1.32.2.jar:./deps-1.33.0/*" org.example.AbiServer
Exception in thread "main" java.lang.NoSuchMethodError:
io.grpc.netty.NettyServerBuilder.handshakeTimeout(JLjava/util/concurrent/TimeUnit;)Lio/grpc/internal/AbstractServerImplBuilder;
at org.example.AbiServer.<init>(AbiServer.java:15)
at org.example.AbiServer.main(AbiServer.java:23)
❯ java -cp "./abi-1.32.2.jar:./deps-1.34-7eac3b0/*" org.example.AbiServer
ServerImpl{logId=2, transportServers=[NettyServer{logId=1, address=0.0.0.0/0.0.0.0:10000}]} src: package org.example;
import java.util.concurrent.TimeUnit;
import io.grpc.Server;
import io.grpc.ServerBuilder;
import io.grpc.netty.NettyServerBuilder;
public class AbiServer {
private final NettyServerBuilder nsb;
public AbiServer() {
nsb = NettyServerBuilder
.forPort(10_000)
.initialFlowControlWindow(100) // own in 1.32.2
.handshakeTimeout(Long.MAX_VALUE, TimeUnit.SECONDS); // moved from abstract to fwd in v1.33.0
}
public ServerBuilder getBuilder() {
return nsb;
}
public static void main(String[] args) {
AbiServer me = new AbiServer();
Server s = me.getBuilder().build();
System.out.println(s);
}
} |
ejona86
approved these changes
Oct 29, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's this PR do?
Brings back
io.grpc.internal.AbstractManagedChannelImplBuilder
andio.grpc.internal.AbstractServerImplBuilder
to the class hierarchy to fix broken ABI backward compatibility.Any background context you want to provide?
AbstractManagedChannelImplBuilder
AbstractManagedChannelImplBuilder
brought back as a copy ofForwardingChannelBuilder
support pre-v1.33 binary interface, e.g.io.grpc.netty.NettyChannelBuilder.maxInboundMessageSize(I)Lio/grpc/internal/AbstractManagedChannelImplBuilder;
AbstractServerImplBuilder
io.grpc.internal.AbstractManagedChannelImplBuilder
andio.grpc.internal.AbstractServerImplBuilder
to the class hierarchy to fix broken ABI backward compatibility.ForwardingServerBuilder
was introduced in v1.33.0, I changed it toForwardingServerBuilder<T extends ServerBuilder<T>>
. and made it package-private.What are the relevant tickets?