slievrly commented on code in PR #6325:
URL: https://github.com/apache/incubator-seata/pull/6325#discussion_r1477582863
##########
test-mock-server/src/main/java/org/apache/seata/mockserver/MockServer.java:
##########
@@ -52,24 +54,33 @@ public static void main(String[] args) {
}
public static void start() {
- workingThreads = new ThreadPoolExecutor(50,
- 50, 500, TimeUnit.SECONDS,
- new LinkedBlockingQueue<>(20000),
- new NamedThreadFactory("ServerHandlerThread", 500), new
ThreadPoolExecutor.CallerRunsPolicy());
- nettyRemotingServer = new MockNettyRemotingServer(workingThreads);
+ if (!inited) {
+ synchronized (MockServer.class) {
+ if (!inited) {
+ inited = true;
+ workingThreads = new ThreadPoolExecutor(50,
+ 50, 500, TimeUnit.SECONDS,
+ new LinkedBlockingQueue<>(20000),
+ new NamedThreadFactory("ServerHandlerThread",
500), new ThreadPoolExecutor.CallerRunsPolicy());
+ nettyRemotingServer = new
MockNettyRemotingServer(workingThreads, 8099);
+
+ // set registry
+ XID.setIpAddress(NetUtil.getLocalIp());
+ XID.setPort(8099);
Review Comment:
ports should be customized, not fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]