Repository: reef Updated Branches: refs/heads/master 2142dd7a3 -> e4a2a075f
[REEF-1721] Close the job submission handler when REEF client closes. Also add some extra logging in the `REEF.close()` call. JIRA: [REEF-1721](https://issues.apache.org/jira/browse/REEF-1721) Closes #1234 Project: http://git-wip-us.apache.org/repos/asf/reef/repo Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/e4a2a075 Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/e4a2a075 Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/e4a2a075 Branch: refs/heads/master Commit: e4a2a075f394c49eb5dc119861ff84c7ba80ebec Parents: 2142dd7 Author: Sergiy Matusevych <[email protected]> Authored: Fri Jan 13 16:08:59 2017 -0800 Committer: Yunseong Lee <[email protected]> Committed: Wed Jan 25 13:04:59 2017 +0900 ---------------------------------------------------------------------- .../runtime/common/client/REEFImplementation.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/reef/blob/e4a2a075/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/client/REEFImplementation.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/client/REEFImplementation.java b/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/client/REEFImplementation.java index 80c7924..ac52922 100644 --- a/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/client/REEFImplementation.java +++ b/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/client/REEFImplementation.java @@ -39,6 +39,7 @@ import org.apache.reef.util.logging.LoggingScopeFactory; import javax.inject.Inject; import java.util.Set; +import java.util.logging.Level; import java.util.logging.Logger; /** @@ -89,8 +90,21 @@ public final class REEFImplementation implements REEF { @Override public void close() { + + LOG.log(Level.FINE, "Close REEF: shutdown jobs"); this.runningJobs.closeAllJobs(); + + LOG.log(Level.FINE, "Close REEF: shutdown client"); this.clientWireUp.close(); + + LOG.log(Level.FINE, "Close REEF: shutdown job submitter"); + try { + this.jobSubmissionHandler.close(); + } catch (final Exception ex) { + LOG.log(Level.WARNING, "Could not shutdown job submitter", ex); + } + + LOG.log(Level.FINE, "Close REEF: done"); } @Override @@ -137,6 +151,4 @@ public final class REEFImplementation implements REEF { @NamedParameter(doc = "The driver remote identifier.") public static final class DriverRemoteIdentifier implements Name<String> { } - - }
