Skip to content

Commit 56ecec7

Browse files
authored
Fix NettyRemotingClient might throw IllegalMonitorStateException (#16038)
1 parent 0fc2fe9 commit 56ecec7

File tree

1 file changed

+4
-7
lines changed
  • dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/client

1 file changed

+4
-7
lines changed

dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/client/NettyRemotingClient.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public IRpcResponse sendSync(final Host host,
141141
return iRpcResponse;
142142
}
143143

144-
private Channel getOrCreateChannel(Host host) {
144+
Channel getOrCreateChannel(Host host) {
145145
Channel channel = channels.get(host);
146146
if (channel != null && channel.isActive()) {
147147
return channel;
@@ -166,13 +166,10 @@ private Channel getOrCreateChannel(Host host) {
166166
* @param host host
167167
* @return channel
168168
*/
169-
private Channel createChannel(Host host) {
169+
Channel createChannel(Host host) {
170170
try {
171-
ChannelFuture future;
172-
synchronized (bootstrap) {
173-
future = bootstrap.connect(new InetSocketAddress(host.getIp(), host.getPort()));
174-
}
175-
future.await(clientConfig.getConnectTimeoutMillis());
171+
ChannelFuture future = bootstrap.connect(new InetSocketAddress(host.getIp(), host.getPort()));
172+
future = future.sync();
176173
if (future.isSuccess()) {
177174
return future.channel();
178175
} else {

0 commit comments

Comments
 (0)