The current job group id of a Spark context is stored in the localProperties member value. This data structure is designed to be thread local, and its settings are not preserved when ComplexFutureAction instantiates a new Future.
One consequence of this is that takeAsync() does not behave in the same way as other async actions, e.g. countAsync(). For example, this test (if copied into StatusTrackerSuite.scala), will fail, because "my-job-group2" is not propagated to the Future which actually instantiates the job:
It also impacts current PR for
SPARK-1021, which involves additional uses of ComplexFutureAction.