Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-7318

Using too many macros causes MapReduce to fail


    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.5.0
    • Fix Version/s: 4.0.0, 3.6.1, 3.5.2
    • Component/s: App Fabric
    • Labels:
    • Release Notes:
      Fixed an issue that would cause MapReduce and Spark programs to fail if too many macros were being used.
    • Rank:


      If you put too many macros in an application config, the mapreduce job fails with something like:

      Caused by: java.lang.IllegalStateException: Variable substitution depth too large: 20 <application config>
              at org.apache.hadoop.conf.Configuration.substituteVars(Configuration.java:962)
              at org.apache.hadoop.conf.Configuration.get(Configuration.java:982)
              at co.cask.cdap.internal.app.runtime.batch.MapReduceContextConfig.getApplicationSpecification(MapReduceContextConfig.java:128)
              at co.cask.cdap.internal.app.runtime.batch.MapReduceTaskContextProvider.createProgram(MapReduceTaskContextProvider.java:150)
              at co.cask.cdap.internal.app.runtime.batch.MapReduceTaskContextProvider.access$200(MapReduceTaskContextProvider.java:61)
              at co.cask.cdap.internal.app.runtime.batch.MapReduceTaskContextProvider$1.load(MapReduceTaskContextProvider.java:175)
              at co.cask.cdap.internal.app.runtime.batch.MapReduceTaskContextProvider$1.load(MapReduceTaskContextProvider.java:166)
              at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3589)
              at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2374)
              at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2337)
              at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2252)
              ... 20 more

      This is due to the fact that CDAP macro syntax is the same as Hadoop Configuration substitution syntax. Unfortunately, 20 is a hardcoded private variable in Hadoop, so there isn't any way to change it. Also unfortunately, though the message also complains about depth, it actually has nothing to do with depth at all and is really just substituting at max 20 variables.

      All this to say that we should just use Configuration.getRaw() instead of Configuration.get() for the cdap app spec.


          Issue Links



              • Assignee:
                ashau Albert Shau
                ashau Albert Shau
              • Votes:
                0 Vote for this issue
                4 Start watching this issue


                • Created: