Skip to content

Commit 06638fd

Browse files
committed
fix bug
1 parent d947e28 commit 06638fd

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

job-core/src/main/java/com/lts/job/core/cluster/MasterElector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void addNodes(List<Node> nodes) {
5151
}
5252
}
5353
}
54-
if (master != newMaster) {
54+
if (master == null || !master.equals(newMaster)) {
5555
master = newMaster;
5656
notifyListener();
5757
}

job-core/src/main/java/com/lts/job/remoting/netty/NettyServerConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package com.lts.job.remoting.netty;
22

3+
import com.lts.job.core.constant.Constants;
4+
35
/**
46
* Netty服务端配置
57
*/
68
public class NettyServerConfig {
79
private int listenPort = 8888;
810
private int serverWorkerThreads = 32;
911
private int serverCallbackExecutorThreads = 0;
10-
private int serverSelectorThreads = 8;
12+
private int serverSelectorThreads = Constants.AVAILABLE_PROCESSOR * 2;
1113
private int serverOnewaySemaphoreValue = 32;
1214
private int serverAsyncSemaphoreValue = 64;
1315
private int serverChannelMaxIdleTimeSeconds = 120;

job-core/src/main/java/com/lts/job/remoting/protocol/RemotingCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class RemotingCommand {
3939
private static final Logger LOGGER = LoggerFactory.getLogger(RemotingCommand.class);
4040

4141
private static final int RPC_TYPE = 0; // 0, REQUEST_COMMAND
42-
private static final int RPC_ONEWAY = 1; // 0, RPC
42+
private static final int RPC_ONEWAY = 1; // 1, RPC
4343
// 1, Oneway
4444
private static AtomicInteger RequestId = new AtomicInteger(0);
4545
/**

0 commit comments

Comments
 (0)