Uploaded image for project: 'Apache Tez'
  1. Apache Tez
  2. TEZ-4080

TezClient should close FileSystem objects to prevent leak

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 0.9.1
    • None
    • None
    • None

    Description

      When opening/closing a lot of tez clients; some FileSystem object references are retained even after the client is closed - due to the fact the FileSystem has a "cache" which collects all open FileSystem objects - to be able to close all of them from a single shutdownhook.

      Not closing these FileSystem objects causes them to pile up in the "cache" which has hard references to them
      In a simple hive test which was run with 150M of memory; these "lost" filesystem objects could result in an OOM after ~170 sessions.

      A sample creation stack trace of a FileSystem object:

              at org.apache.hadoop.hive.ql.io.ProxyLocalFileSystem.<init>(ProxyLocalFileSystem.java:49)
              at sun.reflect.GeneratedConstructorAccessor83.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
              at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
              at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3353)
              at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:124)
              at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3403)
              at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3371)
              at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:477)
              at org.apache.hadoop.fs.Path.getFileSystem(Path.java:361)
              at org.apache.tez.dag.app.DAGAppMaster.serviceInit(DAGAppMaster.java:502)
              at org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
              at org.apache.tez.dag.app.DAGAppMaster$9.run(DAGAppMaster.java:2663)
      

      Attachments

        1. TEZ-4080.branch-0.9.1.patch
          28 kB
          Zoltan Haindrich
        2. TEZ-4080.branch-0.9.1.02.patch
          2 kB
          Zoltan Haindrich

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kgyrtkirk Zoltan Haindrich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: