<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.6</li>
<li>Operating System version: MacOS 10.14.3</li>
<li>Java version: 1.8.0_171</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">When I try to use RpcContext.getServerContext to pass data from provider to cusumer，if the method runs in sync mode, it works（ Provider uses  RpcContext.getServerContext().setAttachment to set Key-Value data，then Consumer uses RpcContext.getServerContext().getAttachment to get the Key-Value Data.). But if the method runs in async mode, it doesn't works. Consumer can't get the Key-Value by RpcContext.getServerContext().getAttachment.</p>
<ol dir="auto">
<li></li>
<li>xxx</li>
<li>xxx</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></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: 2.7.2</li>
<li>Operating System version: Ubuntu 18.04</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">Call <code class="notranslate">base642bytes(String, char[])</code> with a random <code class="notranslate">String</code> and <code class="notranslate">C64.toCharArray()</code>.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import org.apache.dubbo.common.io.Bytes;

public class Testing {

  private static final String C64 = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=&quot;;

  public static void main(String[] args) {
    Bytes.base642bytes(&quot;ZHViYm8=&quot;, C64.toCharArray());
  }
}"><pre class="notranslate"><code class="notranslate">import org.apache.dubbo.common.io.Bytes;

public class Testing {

  private static final String C64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

  public static void main(String[] args) {
    Bytes.base642bytes("ZHViYm8=", C64.toCharArray());
  }
}
</code></pre></div>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">No crash.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto"><code class="notranslate">IndexOutOfBoundsException</code></p>
<p dir="auto">Stack trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Exception in thread &quot;main&quot; java.lang.ArrayIndexOutOfBoundsException: 5
	at org.apache.dubbo.common.io.Bytes.base642bytes(Bytes.java:752)
	at org.apache.dubbo.common.io.Bytes.base642bytes(Bytes.java:692)
	at Testing.main(Testing.java:8)"><pre class="notranslate"><code class="notranslate">Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
	at org.apache.dubbo.common.io.Bytes.base642bytes(Bytes.java:752)
	at org.apache.dubbo.common.io.Bytes.base642bytes(Bytes.java:692)
	at Testing.main(Testing.java:8)
</code></pre></div>