Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-7240 Scaling HDFS
  3. HDFS-11887

Shared XceiverClient should be closed if there is no open clients to avoid resource leak

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • HDFS-7240
    • ozone
    • None
    • Reviewed

    Description

      XceiverClientManager doesn't close client on eviction which can leak resources.

      public XceiverClientManager(Configuration conf) {
      .
      .
      .
                  public void onRemoval(
                      RemovalNotification<String, XceiverClientWithAccessInfo>
                        removalNotification) {
                    // If the reference count is not 0, this xceiver client should not
                    // be evicted, add it back to the cache.
                    WithAccessInfo info = removalNotification.getValue();
                    if (info.hasRefence()) {
                      synchronized (XceiverClientManager.this.openClient) {
                        XceiverClientManager.this
                            .openClient.put(removalNotification.getKey(), info);
                      }
                    }
      

      Also a stack overflow can be triggered because of putting the element back in the cache on eviction.

                      synchronized (XceiverClientManager.this.openClient) {
                        XceiverClientManager.this
                            .openClient.put(removalNotification.getKey(), info);
                      }
      

      This bug will try to fix both of these cases.

      Attachments

        1. HDFS-11887-HDFS-7240.003.patch
          27 kB
          Mukul Kumar Singh
        2. HDFS-11887-HDFS-7240.002.patch
          46 kB
          Mukul Kumar Singh
        3. HDFS-11887-HDFS-7240.001.patch
          7 kB
          Mukul Kumar Singh

        Activity

          People

            msingh Mukul Kumar Singh
            msingh Mukul Kumar Singh
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: