<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.6</li>
<li>Operating System version: centos</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>服务出现线程池打满的情况打印了Dubbo的堆栈<br>
2.但是出现的线程都是等待任务<br>
3.配置了dubbo的业务线程是1000，qps大概是1500+</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">不应该是线程池满了，但是并发量比较高</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">打印的dubbo线程的状态都是这种，我查到是说现在这个状态都是空闲状态</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;DubboServerHandler-xxx-thread-234&quot; Id=322 WAITING on java.util.concurrent.SynchronousQueue$TransferStack@53452753
	at sun.misc.Unsafe.park(Native Method)
	-  waiting on java.util.concurrent.SynchronousQueue$TransferStack@53452753
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:458)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.take(SynchronousQueue.java:924)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)"><pre lang="log" class="notranslate"><code class="notranslate">"DubboServerHandler-xxx-thread-234" Id=322 WAITING on java.util.concurrent.SynchronousQueue$TransferStack@53452753
	at sun.misc.Unsafe.park(Native Method)
	-  waiting on java.util.concurrent.SynchronousQueue$TransferStack@53452753
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:458)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.take(SynchronousQueue.java:924)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
</code></pre></div>
<p dir="auto">我需要调整线程数吗，还是有什么其他的优化的方法，谢谢</p>
<ul dir="auto">
<li>I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li>I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.0</li>
<li>Operating System version: Ubuntu18.04</li>
<li>Java version: jdk8</li>
</ul>
<ol dir="auto">
<li>dubbo-ops with dubbo 2.7.0 and other appication use old version.</li>
<li>Copy MonitorService from old version to dubbo-ops.</li>
<li>Other application send url call com.alibaba.dubbo.monitor.MonitorService#collect(URL statistics).</li>
</ol>
<p dir="auto">result:<br>
WARN dubbo.DecodeableRpcInvocation -  [DUBBO] Decode argument failed: 'com.alibaba.dubbo.common.URL' could not be instantiated, dubbo version: 2.7.0-SNAPSHOT, current host: 10.236.105.240<br>
com.alibaba.com.caucho.hessian.io.HessianProtocolException: 'com.alibaba.dubbo.common.URL' could not be instantiated</p>
<p dir="auto"><a href="url">https://github.com/ebourg/hessian/blob/git-svn/src/com/caucho/hessian/io/JavaDeserializer.java</a><br>
`for (int i = 0; i &lt; constructors.length; i++) {<br>
Class&lt;?&gt; []param = constructors[i].getParameterTypes();<br>
long cost = 0;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  for (int j = 0; j &lt; param.length; j++) {
    cost = 4 * cost;

    if (Object.class.equals(param[j]))
      cost += 1;
    else if (String.class.equals(param[j]))
      cost += 2;
    else if (int.class.equals(param[j]))
      cost += 3;
    else if (long.class.equals(param[j]))
      cost += 4;
    else if (param[j].isPrimitive())
      cost += 5;
    else
      cost += 6;
  }

  if (cost &lt; 0 || cost &gt; (1 &lt;&lt; 48))
    cost = 1 &lt;&lt; 48;

  cost += (long) param.length &lt;&lt; 48;

  if (cost &lt; bestCost) {
    _constructor = constructors[i];
    bestCost = cost;
  }
}
if (_constructor != null) {
  _constructor.setAccessible(true);
  Class&lt;?&gt; []params = _constructor.getParameterTypes();
  _constructorArgs = new Object[params.length];
  for (int i = 0; i &lt; params.length; i++) {
    _constructorArgs[i] = getParamArg(params[i]);
  }
}`"><pre class="notranslate"><code class="notranslate">  for (int j = 0; j &lt; param.length; j++) {
    cost = 4 * cost;

    if (Object.class.equals(param[j]))
      cost += 1;
    else if (String.class.equals(param[j]))
      cost += 2;
    else if (int.class.equals(param[j]))
      cost += 3;
    else if (long.class.equals(param[j]))
      cost += 4;
    else if (param[j].isPrimitive())
      cost += 5;
    else
      cost += 6;
  }

  if (cost &lt; 0 || cost &gt; (1 &lt;&lt; 48))
    cost = 1 &lt;&lt; 48;

  cost += (long) param.length &lt;&lt; 48;

  if (cost &lt; bestCost) {
    _constructor = constructors[i];
    bestCost = cost;
  }
}
if (_constructor != null) {
  _constructor.setAccessible(true);
  Class&lt;?&gt; []params = _constructor.getParameterTypes();
  _constructorArgs = new Object[params.length];
  for (int i = 0; i &lt; params.length; i++) {
    _constructorArgs[i] = getParamArg(params[i]);
  }
}`
</code></pre></div>
<p dir="auto"><a href="url">https://github.com/apache/incubator-dubbo/blob/master/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/URL.java</a><br>
the bestcost constructor is this one;<br>
<code class="notranslate"> public URL(org.apache.dubbo.common.URL url) { super(url.getProtocol(), url.getUsername(), url.getPassword(), url.getHost(), url.getPort(), url.getPath(), url.getParameters()); }</code></p>
<p dir="auto">and _constructorArgs[0] is null<br>
when run at  _constructor.newInstance(_constructorArgs) application throw NullPointerException</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.alibaba.com.caucho.hessian.io.JavaDeserializer.instantiate(JavaDeserializer.java:312)
	... 32 more
Caused by: java.lang.NullPointerException
	at com.alibaba.dubbo.common.URL.&lt;init&gt;(URL.java:30)"><pre class="notranslate"><code class="notranslate">Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.alibaba.com.caucho.hessian.io.JavaDeserializer.instantiate(JavaDeserializer.java:312)
	... 32 more
Caused by: java.lang.NullPointerException
	at com.alibaba.dubbo.common.URL.&lt;init&gt;(URL.java:30)
</code></pre></div>