diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-02-11 18:14:52 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-02-11 18:15:47 +0100 |
commit | 54cdd41e77bf99b81134435499219eaef4862525 (patch) | |
tree | 6b301d2bcd29166b9edc6d005c1c6a84bfc6ddf0 /server | |
parent | df6129a0913277db1ec8f8ac4b9cc0303b8c9c25 (diff) | |
download | sonarqube-54cdd41e77bf99b81134435499219eaef4862525.tar.gz sonarqube-54cdd41e77bf99b81134435499219eaef4862525.zip |
Fix shutdown of server after DB migration
When a DB migration is required, two containers are up at the same
time ("safemode" and "level 2"). This is not handled by ComponentContainer,
so one of the two children is badly dereferenced and can't be stopped.
Diffstat (limited to 'server')
2 files changed, 2 insertions, 2 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel.java b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel.java index 75f29777a22..d060d8bc2c6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel.java @@ -100,7 +100,7 @@ public abstract class PlatformLevel { */ public PlatformLevel destroy() { if (parent != null) { - parent.container.removeChild(); + parent.container.removeChild(container); } return this; } diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/container/ComputeEngineContainerImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/container/ComputeEngineContainerImplTest.java index e37c1856e9c..13abce63cc8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/container/ComputeEngineContainerImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/container/ComputeEngineContainerImplTest.java @@ -54,7 +54,7 @@ public class ComputeEngineContainerImplTest { ContainerPopulator populator = mock(ContainerPopulator.class); ComputeEngineContainerImpl ceContainer = new ComputeEngineContainerImpl(parent, populator); - assertThat(parent.getChild()).isNull(); + assertThat(parent.getChildren()).isEmpty(); verify(populator).populateContainer(ceContainer); } |