Skip to content

Commit

Permalink
Fix when qos is disable,log will print every time. (#3397)
Browse files Browse the repository at this point in the history
* fix when qos is disable,log will print every time.

* change qos server boos thread number 1
  • Loading branch information
LiZhenNet authored and zonghaishang committed Mar 12, 2019
1 parent dc04701 commit 9ee2f23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,20 @@ public void destroy() {

private void startQosServer(URL url) {
try {
boolean qosEnable = url.getParameter(QOS_ENABLE,true);
if (!hasStarted.compareAndSet(false, true)) {
return;
}

boolean qosEnable = url.getParameter(QOS_ENABLE, true);
if (!qosEnable) {
logger.info("qos won't be started because it is disabled. " +
"Please check dubbo.application.qos.enable is configured either in system property, " +
"dubbo.properties or XML/spring-boot configuration.");
return;
}

if (!hasStarted.compareAndSet(false, true)) {
return;
}

int port = url.getParameter(QOS_PORT, QosConstants.DEFAULT_PORT);
boolean acceptForeignIp = Boolean.parseBoolean(url.getParameter(ACCEPT_FOREIGN_IP,"false"));
boolean acceptForeignIp = Boolean.parseBoolean(url.getParameter(ACCEPT_FOREIGN_IP, "false"));
Server server = Server.getInstance();
server.setPort(port);
server.setAcceptForeignIp(acceptForeignIp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void start() throws Throwable {
if (!started.compareAndSet(false, true)) {
return;
}
boss = new NioEventLoopGroup(0, new DefaultThreadFactory("qos-boss", true));
boss = new NioEventLoopGroup(1, new DefaultThreadFactory("qos-boss", true));
worker = new NioEventLoopGroup(0, new DefaultThreadFactory("qos-worker", true));
ServerBootstrap serverBootstrap = new ServerBootstrap();
serverBootstrap.group(boss, worker);
Expand Down

0 comments on commit 9ee2f23

Please sign in to comment.