This is an automated email from the ASF dual-hosted git repository.
xincheng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 56ecec779c Fix NettyRemotingClient might throw
IllegalMonitorStateException (#16038)
56ecec779c is described below
commit 56ecec779ca7877c1cad9ab27fcd3a7055b8e74a
Author: Wenjun Ruan <[email protected]>
AuthorDate: Wed May 22 10:26:04 2024 +0800
Fix NettyRemotingClient might throw IllegalMonitorStateException (#16038)
---
.../extract/base/client/NettyRemotingClient.java | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git
a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/client/NettyRemotingClient.java
b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/client/NettyRemotingClient.java
index dafaae311d..8ded68669d 100644
---
a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/client/NettyRemotingClient.java
+++
b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/client/NettyRemotingClient.java
@@ -141,7 +141,7 @@ public class NettyRemotingClient implements AutoCloseable {
return iRpcResponse;
}
- private Channel getOrCreateChannel(Host host) {
+ Channel getOrCreateChannel(Host host) {
Channel channel = channels.get(host);
if (channel != null && channel.isActive()) {
return channel;
@@ -166,13 +166,10 @@ public class NettyRemotingClient implements AutoCloseable
{
* @param host host
* @return channel
*/
- private Channel createChannel(Host host) {
+ Channel createChannel(Host host) {
try {
- ChannelFuture future;
- synchronized (bootstrap) {
- future = bootstrap.connect(new InetSocketAddress(host.getIp(),
host.getPort()));
- }
- future.await(clientConfig.getConnectTimeoutMillis());
+ ChannelFuture future = bootstrap.connect(new
InetSocketAddress(host.getIp(), host.getPort()));
+ future = future.sync();
if (future.isSuccess()) {
return future.channel();
} else {