You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Yuxuan Wang (JIRA)" <ji...@apache.org> on 2018/11/19 09:47:00 UTC

[jira] [Created] (HDFS-14088) RequestHedgingProxyProvider can throw NullPointerException when failvoer due to no lock on currentUsedProxy

Yuxuan Wang created HDFS-14088:
----------------------------------

             Summary: RequestHedgingProxyProvider can throw NullPointerException when failvoer due to no lock on currentUsedProxy
                 Key: HDFS-14088
                 URL: https://issues.apache.org/jira/browse/HDFS-14088
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: hdfs-client
            Reporter: Yuxuan Wang



{code:java}
if (currentUsedProxy != null) {
        try {
          Object retVal = method.invoke(currentUsedProxy.proxy, args);
          LOG.debug("Invocation successful on [{}]",
              currentUsedProxy.proxyInfo);
{code}
If a thread run try block and then other thread trigger a fail over calling method
{code:java}
@Override
  public synchronized void performFailover(T currentProxy) {
    toIgnore = this.currentUsedProxy.proxyInfo;
    this.currentUsedProxy = null;
  }
{code}
It will set currentUsedProxy to null, and the first thread can throw a NullPointerException.




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org