<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.7.6</li>
<li>Operating System version: Mac os</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">When I run the demo in org.apache.dubbo.demo.consumer.Application in debug mode, the console log was stoped here，and the thread seems dead.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/9a8115db136e5b39eabf537dadc403f71276adbdd5f8493dce7b0ce7fb7f570a/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039313035372e706e67"><img src="https://camo.githubusercontent.com/9a8115db136e5b39eabf537dadc403f71276adbdd5f8493dce7b0ce7fb7f570a/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039313035372e706e67" alt="" data-canonical-src="http://pic.jingl.wang/2020-04-15-091057.png" style="max-width: 100%;"></a></p>
<p dir="auto">then i use jstack to print thread trace.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2020-04-15 15:51:51
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode):

&quot;Attach Listener&quot; #12 daemon prio=9 os_prio=31 tid=0x00007fb6d392d000 nid=0xf07 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

&quot;Service Thread&quot; #11 daemon prio=9 os_prio=31 tid=0x00007fb6d3872000 nid=0x4503 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

&quot;C1 CompilerThread2&quot; #10 daemon prio=9 os_prio=31 tid=0x00007fb6d30c5800 nid=0x4603 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

&quot;C2 CompilerThread1&quot; #9 daemon prio=9 os_prio=31 tid=0x00007fb6d30c5000 nid=0x3c03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

&quot;C2 CompilerThread0&quot; #8 daemon prio=9 os_prio=31 tid=0x00007fb6d4062000 nid=0x3a03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

&quot;JDWP Command Reader&quot; #7 daemon prio=10 os_prio=31 tid=0x00007fb6d3816000 nid=0x3803 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

&quot;JDWP Event Helper Thread&quot; #6 daemon prio=10 os_prio=31 tid=0x00007fb6d4001000 nid=0x4903 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

&quot;JDWP Transport Listener: dt_socket&quot; #5 daemon prio=10 os_prio=31 tid=0x00007fb6d3813000 nid=0x3607 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

&quot;Signal Dispatcher&quot; #4 daemon prio=9 os_prio=31 tid=0x00007fb6d3052800 nid=0x4b03 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

&quot;Finalizer&quot; #3 daemon prio=8 os_prio=31 tid=0x00007fb6d380e800 nid=0x3003 in Object.wait() [0x0000700001be7000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on &lt;0x0000000795588ed0&gt; (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked &lt;0x0000000795588ed0&gt; (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:212)

&quot;Reference Handler&quot; #2 daemon prio=10 os_prio=31 tid=0x00007fb6d2803000 nid=0x5103 in Object.wait() [0x0000700001ae4000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on &lt;0x0000000795586bf8&gt; (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
	- locked &lt;0x0000000795586bf8&gt; (a java.lang.ref.Reference$Lock)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

&quot;main&quot; #1 prio=5 os_prio=31 tid=0x00007fb6d3804000 nid=0x1703 runnable [0x00007000014d1000]
   java.lang.Thread.State: RUNNABLE
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1718)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtensionLoader(ExtensionLoader.java:144)
	at org.apache.dubbo.common.extension.ExtensionLoader.&lt;init&gt;(ExtensionLoader.java:125)
	at org.apache.dubbo.common.extension.ExtensionLoader.lambda$getExtensionLoader$3(ExtensionLoader.java:144)
	at org.apache.dubbo.common.extension.ExtensionLoader$$Lambda$5/1354011814.apply(Unknown Source)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	- locked &lt;0x0000000796a693c8&gt; (a java.util.concurrent.ConcurrentHashMap$ReservationNode)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtensionLoader(ExtensionLoader.java:144)
	at org.apache.dubbo.config.ReferenceConfig.&lt;clinit&gt;(ReferenceConfig.java:105)
	at org.apache.dubbo.demo.consumer.Application.runWithRefer(Application.java:65)
	at org.apache.dubbo.demo.consumer.Application.main(Application.java:32)

&quot;VM Thread&quot; os_prio=31 tid=0x00007fb6d3046800 nid=0x5303 runnable

&quot;GC task thread#0 (ParallelGC)&quot; os_prio=31 tid=0x00007fb6d2802800 nid=0x1f07 runnable

&quot;GC task thread#1 (ParallelGC)&quot; os_prio=31 tid=0x00007fb6d380c800 nid=0x2a03 runnable

&quot;GC task thread#2 (ParallelGC)&quot; os_prio=31 tid=0x00007fb6d380d800 nid=0x2c03 runnable

&quot;GC task thread#3 (ParallelGC)&quot; os_prio=31 tid=0x00007fb6d380e000 nid=0x2e03 runnable

&quot;VM Periodic Task Thread&quot; os_prio=31 tid=0x00007fb6d30c8800 nid=0x4303 waiting on condition

JNI global references: 3348"><pre class="notranslate"><code class="notranslate">2020-04-15 15:51:51
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode):

"Attach Listener" #12 daemon prio=9 os_prio=31 tid=0x00007fb6d392d000 nid=0xf07 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Service Thread" #11 daemon prio=9 os_prio=31 tid=0x00007fb6d3872000 nid=0x4503 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread2" #10 daemon prio=9 os_prio=31 tid=0x00007fb6d30c5800 nid=0x4603 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #9 daemon prio=9 os_prio=31 tid=0x00007fb6d30c5000 nid=0x3c03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #8 daemon prio=9 os_prio=31 tid=0x00007fb6d4062000 nid=0x3a03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Command Reader" #7 daemon prio=10 os_prio=31 tid=0x00007fb6d3816000 nid=0x3803 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Event Helper Thread" #6 daemon prio=10 os_prio=31 tid=0x00007fb6d4001000 nid=0x4903 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Transport Listener: dt_socket" #5 daemon prio=10 os_prio=31 tid=0x00007fb6d3813000 nid=0x3607 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007fb6d3052800 nid=0x4b03 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fb6d380e800 nid=0x3003 in Object.wait() [0x0000700001be7000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on &lt;0x0000000795588ed0&gt; (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked &lt;0x0000000795588ed0&gt; (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:212)

"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fb6d2803000 nid=0x5103 in Object.wait() [0x0000700001ae4000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on &lt;0x0000000795586bf8&gt; (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
	- locked &lt;0x0000000795586bf8&gt; (a java.lang.ref.Reference$Lock)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

"main" #1 prio=5 os_prio=31 tid=0x00007fb6d3804000 nid=0x1703 runnable [0x00007000014d1000]
   java.lang.Thread.State: RUNNABLE
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1718)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtensionLoader(ExtensionLoader.java:144)
	at org.apache.dubbo.common.extension.ExtensionLoader.&lt;init&gt;(ExtensionLoader.java:125)
	at org.apache.dubbo.common.extension.ExtensionLoader.lambda$getExtensionLoader$3(ExtensionLoader.java:144)
	at org.apache.dubbo.common.extension.ExtensionLoader$$Lambda$5/1354011814.apply(Unknown Source)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	- locked &lt;0x0000000796a693c8&gt; (a java.util.concurrent.ConcurrentHashMap$ReservationNode)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtensionLoader(ExtensionLoader.java:144)
	at org.apache.dubbo.config.ReferenceConfig.&lt;clinit&gt;(ReferenceConfig.java:105)
	at org.apache.dubbo.demo.consumer.Application.runWithRefer(Application.java:65)
	at org.apache.dubbo.demo.consumer.Application.main(Application.java:32)

"VM Thread" os_prio=31 tid=0x00007fb6d3046800 nid=0x5303 runnable

"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fb6d2802800 nid=0x1f07 runnable

"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fb6d380c800 nid=0x2a03 runnable

"GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007fb6d380d800 nid=0x2c03 runnable

"GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007fb6d380e000 nid=0x2e03 runnable

"VM Periodic Task Thread" os_prio=31 tid=0x00007fb6d30c8800 nid=0x4303 waiting on condition

JNI global references: 3348
</code></pre></div>
<p dir="auto">the main thread was blocked when call <code class="notranslate"> ConcurrentHashMap.computeIfAbsent</code> in <code class="notranslate">ExtensionLoader.getExtensionLoader</code><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/ae81e1ed05b3f69d28c178daf14c600e770eef611e8c7932cf74fa02cd382aec/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039313431392e706e67"><img src="https://camo.githubusercontent.com/ae81e1ed05b3f69d28c178daf14c600e770eef611e8c7932cf74fa02cd382aec/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039313431392e706e67" alt="" data-canonical-src="http://pic.jingl.wang/2020-04-15-091419.png" style="max-width: 100%;"></a></p>
<p dir="auto">then i step into method computeIfAbsent and found that this condition is false<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/2db4d2e6566f979c9043f0a27f83620729f535bd6789a86461d11a7720676930/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039323130302e706e67"><img src="https://camo.githubusercontent.com/2db4d2e6566f979c9043f0a27f83620729f535bd6789a86461d11a7720676930/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039323130302e706e67" alt="" data-canonical-src="http://pic.jingl.wang/2020-04-15-092100.png" style="max-width: 100%;"></a><br>
that means the root node in current bin is an ReservationNode,  it only occurs when current node is computing and not finished.</p>
<p dir="auto">then i found that the method <code class="notranslate">computeIfAbsent</code> was called twice in the context, and the second call was called by the first calling.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/2e22729fb0c23f24d1b695b297ae07e0cc896dd29741043e0b02f21a7d52e298/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039333232372e6a7067"><img src="https://camo.githubusercontent.com/2e22729fb0c23f24d1b695b297ae07e0cc896dd29741043e0b02f21a7d52e298/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039333232372e6a7067" alt="" data-canonical-src="http://pic.jingl.wang/2020-04-15-093227.jpg" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/f4d89860bcd4f1756a246c6bc9a507f4fe8a4e27c55830b56387ee6e5ff7db23/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039323933342e706e67"><img src="https://camo.githubusercontent.com/f4d89860bcd4f1756a246c6bc9a507f4fe8a4e27c55830b56387ee6e5ff7db23/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039323933342e706e67" alt="" data-canonical-src="http://pic.jingl.wang/2020-04-15-092934.png" style="max-width: 100%;"></a></p>
<p dir="auto">and each time, the entry was supposed to put in the same bin.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/78514c7f8e227b679395ed90f0c3ecade5c88230b0e673caa4f5403bd72f0b38/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039333330332e706e67"><img src="https://camo.githubusercontent.com/78514c7f8e227b679395ed90f0c3ecade5c88230b0e673caa4f5403bd72f0b38/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039333330332e706e67" alt="" data-canonical-src="http://pic.jingl.wang/2020-04-15-093303.png" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/9725c0bf5053d387cc4c41d63c00e5d69899263bc052d189c9cfaf449bca8035/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039333633362e706e67"><img src="https://camo.githubusercontent.com/9725c0bf5053d387cc4c41d63c00e5d69899263bc052d189c9cfaf449bca8035/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039333633362e706e67" alt="" data-canonical-src="http://pic.jingl.wang/2020-04-15-093636.png" style="max-width: 100%;"></a></p>
<p dir="auto">so the second call would stuck in a dead loop.</p>
<p dir="auto">Then i saw the code in <code class="notranslate">ExtensionLoader.getExtensionLoader(Class type)</code>, it will create a new ExtensionLoader when the target type   can't be found in EXTENSION_LOADERS, and when call ExtensionLoader's instructor, it will create a ExtensionFactory object, and that will call getExtensionLoader again, so that is the reason why there is 2 calling of computeIfAbsent.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/75dc1109c307a6f2c97eedaa3e1ad467f31b6c6e57637c10b4516c64ea55bc86/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039343133362e706e67"><img src="https://camo.githubusercontent.com/75dc1109c307a6f2c97eedaa3e1ad467f31b6c6e57637c10b4516c64ea55bc86/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039343133362e706e67" alt="" data-canonical-src="http://pic.jingl.wang/2020-04-15-094136.png" style="max-width: 100%;"></a></p>
<p dir="auto">so maybe you can replace the code in line 145 by the code in 147 to 148<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/5f60f14f329c861d176b42f5c62ff4ceb1daa3735f2c3ecc2bfb8a2d72ecda61/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039353231302e706e67"><img src="https://camo.githubusercontent.com/5f60f14f329c861d176b42f5c62ff4ceb1daa3735f2c3ecc2bfb8a2d72ecda61/687474703a2f2f7069632e6a696e676c2e77616e672f323032302d30342d31352d3039353231302e706e67" alt="" data-canonical-src="http://pic.jingl.wang/2020-04-15-095210.png" style="max-width: 100%;"></a></p>
<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.7.1</li>
<li>Operating System version: macos</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">目前元数据上报至元数据中心的参数维度不能够满足我的业务，所以想扩展元数据来实现一些个性化参数的上报，以便于其他消费者或网关更好的使用一些特殊场景？</p>