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

FileInputStreamCache.close leaves dangling reference to FileInputStreamCache.cacheCleaner

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.4-alpha
    • 2.1.0-beta
    • hdfs-client
    • None
    • Reviewed

    Description

      FileInputStreamCache leaves around a reference to its cacheCleaner after close().

      The cacheCleaner is created like this:

      if (cacheCleaner == null) {
                cacheCleaner = new CacheCleaner();
                executor.scheduleAtFixedRate(cacheCleaner, expiryTimeMs, expiryTimeMs,
                    TimeUnit.MILLISECONDS);
              }
      

      and supposedly removed like this:

      if (cacheCleaner != null) {
        executor.remove(cacheCleaner);
      }
      

      However, ScheduledThreadPoolExecutor.remove returns a success boolean which should be checked. And I think from a quick read of that class that the return value of scheduleAtFixedRate should be used as the argument to remove.

      Attachments

        1. HDFS-4824.001.patch
          2 kB
          Colin McCabe
        2. HDFS-4824.002.patch
          4 kB
          Colin McCabe

        Activity

          People

            cmccabe Colin McCabe
            henryr Henry Robinson
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: