Skip to content

Commit 595bdc9

Browse files
authored
update destruction log and give better messages (#12950)
1 parent 14becb8 commit 595bdc9

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigHttpClientManager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ public static ConfigHttpClientManager getInstance() {
7171

7272
@Override
7373
public void shutdown() throws NacosException {
74-
NAMING_LOGGER.warn("[ConfigHttpClientManager] Start destroying NacosRestTemplate");
74+
NAMING_LOGGER.info("[ConfigHttpClientManager] Start destroying NacosRestTemplate");
7575
try {
7676
HttpClientBeanHolder.shutdownNacosSyncRest(HTTP_CLIENT_FACTORY.getClass().getName());
7777
} catch (Exception ex) {
7878
NAMING_LOGGER.error("[ConfigHttpClientManager] An exception occurred when the HTTP client was closed : {}",
7979
ExceptionUtil.getStackTrace(ex));
8080
}
81-
NAMING_LOGGER.warn("[ConfigHttpClientManager] Destruction of the end");
81+
NAMING_LOGGER.info("[ConfigHttpClientManager] Completed destruction of NacosRestTemplate");
8282
}
8383

8484
/**

client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientManager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ public NacosRestTemplate getNacosRestTemplate() {
6868

6969
@Override
7070
public void shutdown() throws NacosException {
71-
NAMING_LOGGER.warn("[NamingHttpClientManager] Start destroying NacosRestTemplate");
71+
NAMING_LOGGER.info("[NamingHttpClientManager] Start destroying NacosRestTemplate");
7272
try {
7373
HttpClientBeanHolder.shutdownNacosSyncRest(HTTP_CLIENT_FACTORY.getClass().getName());
7474
} catch (Exception ex) {
7575
NAMING_LOGGER.error("[NamingHttpClientManager] An exception occurred when the HTTP client was closed : {}",
7676
ExceptionUtil.getStackTrace(ex));
7777
}
78-
NAMING_LOGGER.warn("[NamingHttpClientManager] Destruction of the end");
78+
NAMING_LOGGER.info("[NamingHttpClientManager] Completed destruction of NacosRestTemplate");
7979
}
8080

8181
private static class NamingHttpClientFactory extends AbstractHttpClientFactory {

common/src/main/java/com/alibaba/nacos/common/executor/ThreadPoolManager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public final class ThreadPoolManager {
5151
static {
5252
INSTANCE.init();
5353
ThreadUtils.addShutdownHook(new Thread(() -> {
54-
LOGGER.warn("[ThreadPoolManager] Start destroying ThreadPool");
54+
LOGGER.info("[ThreadPoolManager] Start destroying ThreadPool");
5555
shutdown();
56-
LOGGER.warn("[ThreadPoolManager] Destruction of the end");
56+
LOGGER.info("[ThreadPoolManager] Completed destruction of ThreadPool");
5757
}));
5858
}
5959

common/src/main/java/com/alibaba/nacos/common/http/HttpClientBeanHolder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private static void shutdown() {
9999
if (!ALREADY_SHUTDOWN.compareAndSet(false, true)) {
100100
return;
101101
}
102-
LOGGER.warn("[HttpClientBeanHolder] Start destroying common HttpClient");
102+
LOGGER.info("[HttpClientBeanHolder] Start destroying common HttpClient");
103103

104104
try {
105105
shutdown(DefaultHttpClientFactory.class.getName());
@@ -108,7 +108,7 @@ private static void shutdown() {
108108
ExceptionUtil.getStackTrace(ex));
109109
}
110110

111-
LOGGER.warn("[HttpClientBeanHolder] Destruction of the end");
111+
LOGGER.info("[HttpClientBeanHolder] Completed destruction of HttpClient");
112112
}
113113

114114
/**

common/src/main/java/com/alibaba/nacos/common/notify/NotifyCenter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static void shutdown() {
131131
if (!CLOSED.compareAndSet(false, true)) {
132132
return;
133133
}
134-
LOGGER.warn("[NotifyCenter] Start destroying Publisher");
134+
LOGGER.info("[NotifyCenter] Start destroying Publisher");
135135

136136
for (Map.Entry<String, EventPublisher> entry : INSTANCE.publisherMap.entrySet()) {
137137
try {
@@ -148,7 +148,7 @@ public static void shutdown() {
148148
LOGGER.error("[SharePublisher] shutdown has error : ", e);
149149
}
150150

151-
LOGGER.warn("[NotifyCenter] Destruction of the end");
151+
LOGGER.info("[NotifyCenter] Completed destruction of Publisher");
152152
}
153153

154154
/**

config/src/main/java/com/alibaba/nacos/config/server/service/notify/HttpClientManager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static NacosAsyncRestTemplate getNacosAsyncRestTemplate() {
6464
}
6565

6666
private static void shutdown() {
67-
LOGGER.warn("[ConfigServer-HttpClientManager] Start destroying NacosRestTemplate");
67+
LOGGER.info("[ConfigServer-HttpClientManager] Start destroying NacosRestTemplate");
6868
try {
6969
final String httpClientFactoryBeanName = ConfigHttpClientFactory.class.getName();
7070
HttpClientBeanHolder.shutdownNacosSyncRest(httpClientFactoryBeanName);
@@ -73,7 +73,7 @@ private static void shutdown() {
7373
LOGGER.error("[ConfigServer-HttpClientManager] An exception occurred when the HTTP client was closed : {}",
7474
ExceptionUtil.getStackTrace(ex));
7575
}
76-
LOGGER.warn("[ConfigServer-HttpClientManager] Destruction of the end");
76+
LOGGER.info("[ConfigServer-HttpClientManager] Completed destruction of NacosRestTemplate");
7777
}
7878

7979
/**

naming/src/main/java/com/alibaba/nacos/naming/misc/HttpClientManager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static NacosAsyncRestTemplate getProcessorNacosAsyncRestTemplate() {
104104
}
105105

106106
private static void shutdown() {
107-
SRV_LOG.warn("[NamingServerHttpClientManager] Start destroying HTTP-Client");
107+
SRV_LOG.info("[NamingServerHttpClientManager] Start destroying HTTP-Client");
108108
try {
109109
HttpClientBeanHolder.shutdownNacosSyncRest(SYNC_HTTP_CLIENT_FACTORY.getClass().getName());
110110
HttpClientBeanHolder.shutdownNacosSyncRest(APACHE_SYNC_HTTP_CLIENT_FACTORY.getClass().getName());
@@ -114,7 +114,7 @@ private static void shutdown() {
114114
SRV_LOG.error("[NamingServerHttpClientManager] An exception occurred when the HTTP client was closed : {}",
115115
ExceptionUtil.getStackTrace(ex));
116116
}
117-
SRV_LOG.warn("[NamingServerHttpClientManager] Destruction of the end");
117+
SRV_LOG.info("[NamingServerHttpClientManager] Completed destruction of HTTP-Client");
118118
}
119119

120120
private static class AsyncHttpClientFactory extends AbstractHttpClientFactory {

0 commit comments

Comments
 (0)