apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.52k stars 26.43k forks source link

ThreadPoolStatusChecker get wrong pool size message #7033

Closed YoungHu closed 3 years ago

YoungHu commented 3 years ago

Environment

Steps to reproduce this issue

  1. set dubbo thread pool to be 100 <dubbo:protocol port="-1" dispatcher="all" threadpool="fixed" threads="100"/> and enable dubbo monitor <dubbo:monitor protocol="registry" interval="10000"/>

  2. start dubbo provider application

  3. run telnet localhost 20880 when show dubbo flag then run status -l will get pool size is 100 image

  4. start a dubbo consumer applicaiton

  5. do step 3 again, pool size change to 0 image

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

step 5 should show pool size is 100

Actual Result

step 5 show pool size is 0

Troubleshooting

image image image image Then the executor changed to MonitorService executor with no pool.

solution

best:

add map.put(Constants.SIDE_KEY, Constants.CONSUMER_SIDE); into AbstractInterfaceConfig.loadMonitor method

temporary fix:

dubbo monitor config like this image

chickenlj commented 3 years ago

I am a bit confused here. Most of the time status -l should be used to monitor the status of the Dubbo provider threadpool. What's the meaning of showing the pool of the Consumer consuming MonitorService?

YoungHu commented 3 years ago

yes, status -l is use to monitor the status of the dubbo provider thread pool. but dubbo monitor haven't mark it self as consumer, so it override the provider thread pool data. finally, we got the wrong data.