Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14088

RequestHedgingProxyProvider can throw NullPointerException when failover due to no lock on currentUsedProxy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.0
    • hdfs-client
    • None

    Description

      if (currentUsedProxy != null) {
              try {
                Object retVal = method.invoke(currentUsedProxy.proxy, args);
                LOG.debug("Invocation successful on [{}]",
                    currentUsedProxy.proxyInfo);
      

      If a thread run try block and then other thread trigger a fail over calling method

      @Override
        public synchronized void performFailover(T currentProxy) {
          toIgnore = this.currentUsedProxy.proxyInfo;
          this.currentUsedProxy = null;
        }
      

      It will set currentUsedProxy to null, and the first thread can throw a NullPointerException.

      Attachments

        1. HDFS-14088.001.patch
          13 kB
          Yuxuan Wang
        2. HDFS-14088.002.patch
          13 kB
          Yuxuan Wang
        3. HDFS-14088.003.patch
          14 kB
          Yuxuan Wang
        4. HDFS-14088.004.patch
          17 kB
          Yuxuan Wang
        5. HDFS-14088.005.patch
          16 kB
          Yuxuan Wang
        6. HDFS-14088.006.patch
          15 kB
          Yuxuan Wang

        Activity

          People

            John Smith Yuxuan Wang
            John Smith Yuxuan Wang
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: