Skip to content

Commit

Permalink
HDDS-11257. Ozone write does not work when http proxy is set for the …
Browse files Browse the repository at this point in the history
…JVM. (#7036)
  • Loading branch information
sadanand48 authored Aug 7, 2024
1 parent e091e47 commit 6569278
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ protected NettyChannelBuilder createChannel(DatanodeDetails dn, int port)
NettyChannelBuilder channelBuilder =
NettyChannelBuilder.forAddress(dn.getIpAddress(), port).usePlaintext()
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
.proxyDetector(uri -> null)
.intercept(new GrpcClientInterceptor());
if (secConfig.isSecurityEnabled() && secConfig.isGrpcTlsEnabled()) {
SslContextBuilder sslContextBuilder = GrpcSslContexts.forClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public GrpcReplicationClient(
NettyChannelBuilder channelBuilder =
NettyChannelBuilder.forAddress(host, port)
.usePlaintext()
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE);
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
.proxyDetector(uri -> null);

if (secConfig.isSecurityEnabled() && secConfig.isGrpcTlsEnabled()) {
channelBuilder.useTransportSecurity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public InterSCMGrpcClient(final String host,
TimeUnit.MILLISECONDS);
NettyChannelBuilder channelBuilder =
NettyChannelBuilder.forAddress(host, port).usePlaintext()
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE);
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
.proxyDetector(uri -> null);
SecurityConfig securityConfig = new SecurityConfig(conf);
if (securityConfig.isSecurityEnabled()
&& securityConfig.isGrpcTlsEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public void start() throws IOException {
NettyChannelBuilder channelBuilder =
NettyChannelBuilder.forAddress(hp.getHost(), hp.getPort())
.usePlaintext()
.proxyDetector(uri -> null)
.maxInboundMessageSize(maxSize);

if (secConfig.isSecurityEnabled() && secConfig.isGrpcTlsEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ public Void call() throws Exception {
.build();

NettyChannelBuilder channelBuilder =
NettyChannelBuilder.forTarget(serverAddress);
NettyChannelBuilder.forTarget(serverAddress)
.proxyDetector(uri -> null);
channelBuilder.negotiationType(NegotiationType.PLAINTEXT);
ManagedChannel build = channelBuilder.build();
stub = RaftServerProtocolServiceGrpc.newStub(build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public Void call() throws Exception {
.build();

NettyChannelBuilder channelBuilder =
NettyChannelBuilder.forTarget(serverAddress);
NettyChannelBuilder.forTarget(serverAddress).proxyDetector(uri -> null);
channelBuilder.negotiationType(NegotiationType.PLAINTEXT);
ManagedChannel build = channelBuilder.build();
stub = RaftServerProtocolServiceGrpc.newStub(build);
Expand Down

0 comments on commit 6569278

Please sign in to comment.