Github user mxm commented on the pull request: https://github.com/apache/flink/pull/681#issuecomment-104707707 I've updated the pull request. - The `JobID` is now propagated from the `ExecutionEnvironment` to the `JobGraph`. That's why a setter for setting the `JobID` at the `JobGraph` was necessary. It is ensured that the `JobID` can never be set to null. Job graphs which are instantiated manually, still generate a random `JobID` which does not depend on the session. - A session timeout has been introduced that specifies the life span of a session. A timeout of zero implies immediate termination of the session after the job has been completed. Otherwise the `ExecutionGraph` is kept for the specified number of seconds. - The methods `startNewSession()` and `setSessionTimeout(timeout)` have been added to the `ExecutionEnvironment`. - The method `endSession()` has been added to the `Client` which is invoked through the `RemoteExecutor` or the `ContextEnvironment`. - The `LocalExecutor` has been modified to respect the session, i.e. it does not shut down the Flink cluster it creates after execution when a session timeout >0 has been specified. In case a new session is invoked through the `LocalEnvironment`, a new LocalExecutor is created. - The `finalize()` and a shutdown hook try to end the session when the `ExecutionEnvironment` gets garbage collected or the JVM is shut down. I'm missing integration tests for the `RemoteEnvironment` and `LocalEnvironment` but there is not much to test at the moment. The core session functionality is tested in the `JobManagerITCase`.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---