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

FileInputStreamCache.close leaves dangling reference to FileInputStreamCache.cacheCleaner

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4-alpha
    • Fix Version/s: 2.1.0-beta
    • Component/s: hdfs-client
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      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.002.patch
          4 kB
          Colin P. McCabe
        2. HDFS-4824.001.patch
          2 kB
          Colin P. McCabe

          Activity

            People

            • Assignee:
              cmccabe Colin P. McCabe
              Reporter:
              henryr Henry Robinson
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: