Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-13891 HDFS RBF stabilization phase I
  3. HDFS-13834

RBF: Connection creator thread should catch Throwable

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 3.3.0, HDFS-13891
    • None
    • None
    • Reviewed

    Description

      Connection creator thread is a single thread thats responsible for creating all downstream namenode connections.

      This is very critical thread and hence should not die understand exception/error scenarios.

      We saw this behavior in production systems where the thread died leaving the router process in bad state.

      The thread should also catch a generic error/exception.

      
          @Override
          public void run() {
            while (this.running) {
              try {
                ConnectionPool pool = this.queue.take();
                try {
                  int total = pool.getNumConnections();
                  int active = pool.getNumActiveConnections();
                  if (pool.getNumConnections() < pool.getMaxSize() &&
                      active >= MIN_ACTIVE_RATIO * total) {
                    ConnectionContext conn = pool.newConnection();
                    pool.addConnection(conn);
                  } else {
                    LOG.debug("Cannot add more than {} connections to {}",
                        pool.getMaxSize(), pool);
                  }
                } catch (IOException e) {
                  LOG.error("Cannot create a new connection", e);
                }
              } catch (InterruptedException e) {
                LOG.error("The connection creator was interrupted");
                this.running = false;
              }
            }
      
      

      Attachments

        1. HDFS-13834-HDFS-13891.5.patch
          5 kB
          CR Hota
        2. HDFS-13834-HDFS-13891.4.patch
          4 kB
          CR Hota
        3. HDFS-13834-HDFS-13891.3.patch
          4 kB
          CR Hota
        4. HDFS-13834-HDFS-13891.2.patch
          4 kB
          CR Hota
        5. HDFS-13834-HDFS-13891.1.patch
          4 kB
          CR Hota
        6. HDFS-13834-HDFS-13891.0.patch
          3 kB
          CR Hota
        7. HDFS-13834.1.patch
          0.8 kB
          CR Hota
        8. HDFS-13834.0.patch
          0.8 kB
          CR Hota

        Activity

          People

            crh CR Hota
            crh CR Hota
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: