Closed welcc closed 2 years ago
问题原因排查: 1.查看dubbo源码(org.apache.dubbo.monitor.dubbo.MetricsFilter)发现获取线程池统计数据实现过程是这样的,从DataStore中获取线程池,然后获取线程池数据: private List getThreadPoolMessage() { DataStore dataStore = ExtensionLoader.getExtensionLoader(DataStore.class).getDefaultExtension(); Map<String, Object> executors = dataStore.get(EXECUTOR_SERVICE_COMPONENT_KEY); ... } 2.但是在 https://github.com/apache/dubbo/commit/2484877189c89e12c0ff67504838b702153aa016#diff-45baf3c442a606b31ed84241935cf0cbc571a532cad96bf9b27b4365fb1f0db6 (Reduce context switching cost by optimizing thread model on consumer …)这次commit中去掉了将创建的线程池放入DataStore中的代码:
3.改为用org.apache.dubbo.common.threadpool.manager.DefaultExecutorRepository存储线程池:
这样导致MetricsFilter中获取线程池监控数据的逻辑失效。
4.并且DefaultExecutorRepository中存储线程池的容器为private,没有提供外部获取方式,只能通过getExecutor(URL url) 获取 但是这个根据url获取线程池的方式在MetricsFilter无法使用
I have fixed this bug yet. Please help me for review.
这货都开始标识过期了,也没写替代的类,哎
Observability under construction in 3.1.x version, progresses will be updated there.
Environment
Steps to reproduce this issue
provider: filter: metrics metrics: protocol: dubbo port: 20880
问题原因排查: 1.查看dubbo源码(org.apache.dubbo.monitor.dubbo.MetricsFilter)发现获取线程池统计数据实现过程是这样的,从DataStore中获取线程池,然后获取线程池数据: private List getThreadPoolMessage() {
DataStore dataStore = ExtensionLoader.getExtensionLoader(DataStore.class).getDefaultExtension();
Map<String, Object> executors = dataStore.get(EXECUTOR_SERVICE_COMPONENT_KEY);
...
}
2.但是在 https://github.com/apache/dubbo/commit/2484877189c89e12c0ff67504838b702153aa016#diff-45baf3c442a606b31ed84241935cf0cbc571a532cad96bf9b27b4365fb1f0db6
(Reduce context switching cost by optimizing thread model on consumer …)这次commit中去掉了将创建的线程池放入DataStore中的代码:
3.改为用org.apache.dubbo.common.threadpool.manager.DefaultExecutorRepository存储线程池:
这样导致MetricsFilter中获取线程池监控数据的逻辑失效。
4.并且DefaultExecutorRepository中存储线程池的容器为private,没有提供外部获取方式,只能通过getExecutor(URL url) 获取 但是这个根据url获取线程池的方式在MetricsFilter无法使用