This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 6283eb4 perf: Make invokers visible to all threads (#8183)
6283eb4 is described below
commit 6283eb44e1f35d91cc880b9090683677a53c2170
Author: Xiong, Pin <[email protected]>
AuthorDate: Fri Jul 2 00:21:13 2021 -0500
perf: Make invokers visible to all threads (#8183)
1. make invokers visible
2. update log variable style and access permission
---
.../main/java/org/apache/dubbo/rpc/cluster/RouterChain.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/RouterChain.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/RouterChain.java
index c37d63f..cdf2993 100644
--- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/RouterChain.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/RouterChain.java
@@ -50,10 +50,10 @@ import static
org.apache.dubbo.rpc.cluster.Constants.STATE_ROUTER_KEY;
* Router chain
*/
public class RouterChain<T> {
- public static final Logger LOGGER =
LoggerFactory.getLogger(RouterChain.class);
+ private static final Logger logger =
LoggerFactory.getLogger(RouterChain.class);
// full list of addresses from registry, classified by method name.
- private List<Invoker<T>> invokers = Collections.emptyList();
+ private volatile List<Invoker<T>> invokers = Collections.emptyList();
// containing all routers, reconstruct every time 'route://' urls change.
private volatile List<Router> routers = Collections.emptyList();
@@ -223,7 +223,7 @@ public class RouterChain<T> {
//file cache
routerCacheMap.put(stateRouter.getName(), routerCache);
} catch (Throwable t) {
- LOGGER.error("Failed to pool router: " + stateRouter.getUrl()
+ ", cause: " + t.getMessage(), t);
+ logger.error("Failed to pool router: " + stateRouter.getUrl()
+ ", cause: " + t.getMessage(), t);
return;
}
}
@@ -303,7 +303,7 @@ public class RouterChain<T> {
try {
router.stop();
} catch (Exception e) {
- LOGGER.error("Error trying to stop router " +
router.getClass(), e);
+ logger.error("Error trying to stop router " +
router.getClass(), e);
}
}
routers = Collections.emptyList();
@@ -313,7 +313,7 @@ public class RouterChain<T> {
try {
router.stop();
} catch (Exception e) {
- LOGGER.error("Error trying to stop stateRouter " +
router.getClass(), e);
+ logger.error("Error trying to stop stateRouter " +
router.getClass(), e);
}
}
stateRouters = Collections.emptyList();