Browse Source

[Bug][Refactor][issue-3157]use cas to avoid thread safe problem (#3158)

Co-authored-by: lgcareer <18610854716@163.com>
pull/3/MERGE
tswstarplanet 4 years ago committed by GitHub
parent
commit
bf3cc0d00e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/NettyRemotingServer.java

9
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/NettyRemotingServer.java

@ -119,11 +119,7 @@ public class NettyRemotingServer {
* server start * server start
*/ */
public void start(){ public void start(){
if (isStarted.compareAndSet(false, true)) {
if(this.isStarted.get()){
return;
}
this.serverBootstrap this.serverBootstrap
.group(this.bossGroup, this.workGroup) .group(this.bossGroup, this.workGroup)
.channel(NioServerSocketChannel.class) .channel(NioServerSocketChannel.class)
@ -155,8 +151,7 @@ public class NettyRemotingServer {
} else { } else {
throw new RuntimeException(String.format("NettyRemotingServer bind %s fail", serverConfig.getListenPort())); throw new RuntimeException(String.format("NettyRemotingServer bind %s fail", serverConfig.getListenPort()));
} }
// }
isStarted.compareAndSet(false, true);
} }
/** /**

Loading…
Cancel
Save