Skip to content

Commit 6569278

Browse files
authored
HDDS-11257. Ozone write does not work when http proxy is set for the JVM. (#7036)
1 parent e091e47 commit 6569278

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
@@ -191,6 +191,7 @@ protected NettyChannelBuilder createChannel(DatanodeDetails dn, int port)
191191
NettyChannelBuilder channelBuilder =
192192
NettyChannelBuilder.forAddress(dn.getIpAddress(), port).usePlaintext()
193193
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
194+
.proxyDetector(uri -> null)
194195
.intercept(new GrpcClientInterceptor());
195196
if (secConfig.isSecurityEnabled() && secConfig.isGrpcTlsEnabled()) {
196197
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
@@ -74,7 +74,8 @@ public GrpcReplicationClient(
7474
NettyChannelBuilder channelBuilder =
7575
NettyChannelBuilder.forAddress(host, port)
7676
.usePlaintext()
77-
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE);
77+
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
78+
.proxyDetector(uri -> null);
7879

7980
if (secConfig.isSecurityEnabled() && secConfig.isGrpcTlsEnabled()) {
8081
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
@@ -67,7 +67,8 @@ public InterSCMGrpcClient(final String host,
6767
TimeUnit.MILLISECONDS);
6868
NettyChannelBuilder channelBuilder =
6969
NettyChannelBuilder.forAddress(host, port).usePlaintext()
70-
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE);
70+
.maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
71+
.proxyDetector(uri -> null);
7172
SecurityConfig securityConfig = new SecurityConfig(conf);
7273
if (securityConfig.isSecurityEnabled()
7374
&& 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
@@ -145,6 +145,7 @@ public void start() throws IOException {
145145
NettyChannelBuilder channelBuilder =
146146
NettyChannelBuilder.forAddress(hp.getHost(), hp.getPort())
147147
.usePlaintext()
148+
.proxyDetector(uri -> null)
148149
.maxInboundMessageSize(maxSize);
149150

150151
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)