Skip to content

Commit 26599b0

Browse files
tanvipenumudysadanand48
authored andcommitted
CDPD-72782. HDDS-11257. Ozone write does not work when http proxy is set for the JVM. (apache#7036) (apache#212)
(cherry picked from commit 6569278) Co-authored-by: Sadanand Shenoy <sadanand.shenoy4898@gmail.com>
1 parent f699c73 commit 26599b0

6 files changed

Lines changed: 9 additions & 4 deletions

File tree

hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientGrpc.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ protected NettyChannelBuilder createChannel(DatanodeDetails dn, int port)
197197
NettyChannelBuilder channelBuilder =
198198
NettyChannelBuilder.forAddress(dn.getIpAddress(), port).usePlaintext()
199199
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
200+
.proxyDetector(uri -> null)
200201
.intercept(new GrpcClientInterceptor());
201202
if (secConfig.isSecurityEnabled() && secConfig.isGrpcTlsEnabled()) {
202203
SslContextBuilder sslContextBuilder = GrpcSslContexts.forClient();

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/GrpcReplicationClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public GrpcReplicationClient(
7575
NettyChannelBuilder channelBuilder =
7676
NettyChannelBuilder.forAddress(host, port)
7777
.usePlaintext()
78-
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE);
78+
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
79+
.proxyDetector(uri -> null);
7980

8081
if (secConfig.isSecurityEnabled() && secConfig.isGrpcTlsEnabled()) {
8182
channelBuilder.useTransportSecurity();

hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/InterSCMGrpcClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public InterSCMGrpcClient(final String host,
6868
TimeUnit.MILLISECONDS);
6969
NettyChannelBuilder channelBuilder =
7070
NettyChannelBuilder.forAddress(host, port).usePlaintext()
71-
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE);
71+
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
72+
.proxyDetector(uri -> null);
7273
SecurityConfig securityConfig = new SecurityConfig(conf);
7374
if (securityConfig.isSecurityEnabled()
7475
&& securityConfig.isGrpcTlsEnabled()) {

hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/GrpcOmTransport.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public void start() throws IOException {
141141
NettyChannelBuilder channelBuilder =
142142
NettyChannelBuilder.forAddress(hp.getHost(), hp.getPort())
143143
.usePlaintext()
144+
.proxyDetector(uri -> null)
144145
.maxInboundMessageSize(maxSize);
145146

146147
if (secConfig.isSecurityEnabled() && secConfig.isGrpcTlsEnabled()) {

hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/FollowerAppendLogEntryGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ public Void call() throws Exception {
168168
.build();
169169

170170
NettyChannelBuilder channelBuilder =
171-
NettyChannelBuilder.forTarget(serverAddress);
171+
NettyChannelBuilder.forTarget(serverAddress)
172+
.proxyDetector(uri -> null);
172173
channelBuilder.negotiationType(NegotiationType.PLAINTEXT);
173174
ManagedChannel build = channelBuilder.build();
174175
stub = RaftServerProtocolServiceGrpc.newStub(build);

hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/LeaderAppendLogEntryGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public Void call() throws Exception {
144144
.build();
145145

146146
NettyChannelBuilder channelBuilder =
147-
NettyChannelBuilder.forTarget(serverAddress);
147+
NettyChannelBuilder.forTarget(serverAddress).proxyDetector(uri -> null);
148148
channelBuilder.negotiationType(NegotiationType.PLAINTEXT);
149149
ManagedChannel build = channelBuilder.build();
150150
stub = RaftServerProtocolServiceGrpc.newStub(build);

0 commit comments

Comments
 (0)