[jvm-packages] Deterministically XGBoost training on exception (#2405)

Previously the code relied on the tracker process being terminated
by the OS, which was not the case on Windows.

Closes #2394
This commit is contained in:
Sergei Lebedev
2017-06-13 05:19:28 +02:00
committed by Nan Zhu
parent 34dfe2f6de
commit 0db37c05bd
4 changed files with 27 additions and 16 deletions

View File

@@ -127,6 +127,12 @@ private[scala] class RabitTracker(numWorkers: Int, port: Option[Int] = None,
}
}
def stop(): Unit = {
if (!system.isTerminated) {
system.shutdown()
}
}
/**
* Get a Map of necessary environment variables to initiate Rabit workers.
*