Skip to content

Commit

Permalink
upgrade grpc to 1.50.2
Browse files Browse the repository at this point in the history
  • Loading branch information
KomachiSion committed Nov 17, 2022
1 parent 3a1bdcf commit 0d70da5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jraft-extension/rpc-grpc-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<name>jraft-extension ${project.version}</name>

<properties>
<io.grpc.version>1.17.0</io.grpc.version>
<io.grpc.version>1.50.2</io.grpc.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,23 @@
*/
public class NettyConnectionHelper {

private static final ReferenceFieldUpdater<NettyServerStream, Channel> CHANNEL_GETTER = Updaters
private static final ReferenceFieldUpdater<NettyServerStream, WriteQueue> WRITE_QUEUE_GETTER = Updaters
.newReferenceFieldUpdater(
NettyServerStream.class,
"channel");
"writeQueue");

private static final ReferenceFieldUpdater<WriteQueue, Channel> CHANNEL_GETTER = Updaters
.newReferenceFieldUpdater(
WriteQueue.class,
"channel");

private static final AttributeKey<NettyConnection> NETTY_CONN_KEY = AttributeKey
.valueOf("netty.conn");

public static Connection getOrCreateConnection(final ServerStream stream,
final List<ConnectionClosedEventListener> listeners) {
if (stream instanceof NettyServerStream) {
return attachChannel(CHANNEL_GETTER.get((NettyServerStream) stream), listeners);
return attachChannel(CHANNEL_GETTER.get(WRITE_QUEUE_GETTER.get((NettyServerStream) stream)), listeners);
}
return null;
}
Expand Down

0 comments on commit 0d70da5

Please sign in to comment.