<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/incubator-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/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.6.2 and lower</li>
<li>Operating System version: all version</li>
<li>Java version: all version</li>
</ul>
<h3 dir="auto">Step to reproduce this issue</h3>
<ol dir="auto">
<li>shutdown provider</li>
<li>consumer side use <code class="notranslate">ReferenceConfigCache.get()</code> to invoke provider</li>
<li>invoke provider one time</li>
<li>startup provider</li>
<li>invoker provider again</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">when provider startup, the second time invoke should success.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">second time invoke failed</p>
<h3 dir="auto">What cause it</h3>
<p dir="auto">When no provider, <code class="notranslate">config.get()</code> return null, at this time we shouldn't store this reference into cache.</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public &lt;T&gt; T get(ReferenceConfig&lt;T&gt; referenceConfig) {
        String key = generator.generateKey(referenceConfig);

        ReferenceConfig&lt;?&gt; config = cache.get(key);
        if (config != null) {
            return (T) config.get();
        }

        cache.putIfAbsent(key, referenceConfig);
        config = cache.get(key);
        return (T) config.get();
    }"><pre class="notranslate"><span class="pl-k">public</span> &lt;<span class="pl-smi">T</span>&gt; <span class="pl-s1">T</span> <span class="pl-en">get</span>(<span class="pl-s1">ReferenceConfig</span>&lt;<span class="pl-s1">T</span>&gt; <span class="pl-s1">referenceConfig</span>) {
        <span class="pl-smi">String</span> <span class="pl-s1">key</span> = <span class="pl-s1">generator</span>.<span class="pl-en">generateKey</span>(<span class="pl-s1">referenceConfig</span>);

        <span class="pl-smi">ReferenceConfig</span>&lt;?&gt; <span class="pl-s1">config</span> = <span class="pl-s1">cache</span>.<span class="pl-en">get</span>(<span class="pl-s1">key</span>);
        <span class="pl-k">if</span> (<span class="pl-s1">config</span> != <span class="pl-c1">null</span>) {
            <span class="pl-k">return</span> (<span class="pl-smi">T</span>) <span class="pl-s1">config</span>.<span class="pl-en">get</span>();
        }

        <span class="pl-s1">cache</span>.<span class="pl-en">putIfAbsent</span>(<span class="pl-s1">key</span>, <span class="pl-s1">referenceConfig</span>);
        <span class="pl-s1">config</span> = <span class="pl-s1">cache</span>.<span class="pl-en">get</span>(<span class="pl-s1">key</span>);
        <span class="pl-k">return</span> (<span class="pl-smi">T</span>) <span class="pl-s1">config</span>.<span class="pl-en">get</span>();
    }</pre></div>
<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: master branch</li>
<li>Operating System version: all</li>
<li>Java version: all</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">fastjson &lt;= 1.2.48 considers vulnerable, see <a href="https://www.anquanke.com/post/id/181874" rel="nofollow">https://www.anquanke.com/post/id/181874</a><br>
we are using 1.2.46, I think it's better to use the latest version <a href="https://github.com/alibaba/fastjson/releases/tag/1.2.58">fastjson-1.2.58</a> if possible.</p>