GEODE-739: CI failure in LocatorJUnitTest.testNoThreadLeftBehind The locator needs to shut down its TCPServer thread if an exception is thrown during startup.
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/08262a85 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/08262a85 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/08262a85 Branch: refs/heads/feature/GEODE-714 Commit: 08262a8544d349482abbc758b44921a3baf92f6b Parents: 3e5ade7 Author: Bruce Schuchardt <bschucha...@pivotal.io> Authored: Thu Jan 7 09:36:25 2016 -0800 Committer: Bruce Schuchardt <bschucha...@pivotal.io> Committed: Thu Jan 7 09:36:52 2016 -0800 ---------------------------------------------------------------------- .../gemfire/distributed/internal/InternalLocator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/08262a85/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java index 9d28d1c..50a0fa9 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java @@ -418,7 +418,12 @@ public class InternalLocator extends Locator implements ConnectListener { // } InternalDistributedSystem sys = InternalDistributedSystem.getConnectedInstance(); if (sys != null) { - slocator.startServerLocation(sys); + try { + slocator.startServerLocation(sys); + } catch (RuntimeException e) { + slocator.stop(); + throw e; + } } slocator.endStartLocator(null);