Skip to content

Commit

Permalink
Fix error code in 3.2 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ committed Dec 25, 2022
1 parent 50e4d8f commit 2d411f1
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.apache.dubbo.remoting.transport.netty;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.NamedThreadFactory;
Expand Down Expand Up @@ -49,6 +49,7 @@
import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
import static org.apache.dubbo.common.constants.CommonConstants.BACKLOG_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.IO_THREADS_KEY;
import static org.apache.dubbo.common.constants.LoggerCodeConstants.TRANSPORT_FAILED_CLOSE;
import static org.apache.dubbo.remoting.Constants.EVENT_LOOP_BOSS_POOL_NAME;
import static org.apache.dubbo.remoting.Constants.EVENT_LOOP_WORKER_POOL_NAME;

Expand All @@ -57,7 +58,7 @@
*/
public class NettyPortUnificationServer extends AbstractPortUnificationServer {

private static final Logger logger = LoggerFactory.getLogger(NettyPortUnificationServer.class);
private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(NettyPortUnificationServer.class);

private Map<String, Channel> dubboChannels = new ConcurrentHashMap<>();// <ip:port, channel>

Expand Down Expand Up @@ -138,7 +139,7 @@ protected void doClose() {
channel.close();
}
} catch (Throwable e) {
logger.warn(e.getMessage(), e);
logger.warn(TRANSPORT_FAILED_CLOSE, "", "", e.getMessage(), e);
}
try {
Collection<Channel> channels = getChannels();
Expand All @@ -147,12 +148,12 @@ protected void doClose() {
try {
channel.close();
} catch (Throwable e) {
logger.warn(e.getMessage(), e);
logger.warn(TRANSPORT_FAILED_CLOSE, "", "", e.getMessage(), e);
}
}
}
} catch (Throwable e) {
logger.warn(e.getMessage(), e);
logger.warn(TRANSPORT_FAILED_CLOSE, "", "", e.getMessage(), e);
}
for (WireProtocol protocol : getProtocols()) {
protocol.close();
Expand All @@ -164,14 +165,14 @@ protected void doClose() {
bootstrap.releaseExternalResources();
}
} catch (Throwable e) {
logger.warn(e.getMessage(), e);
logger.warn(TRANSPORT_FAILED_CLOSE, "", "", e.getMessage(), e);
}
try {
if (dubboChannels != null) {
dubboChannels.clear();
}
} catch (Throwable e) {
logger.warn(e.getMessage(), e);
logger.warn(TRANSPORT_FAILED_CLOSE, "", "", e.getMessage(), e);
}
}

Expand Down

0 comments on commit 2d411f1

Please sign in to comment.