add debug logging for when entities are unmanaging
find out why VanillaSPTest.testUseSshMonitoringDisabled fails occasionally at server
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
index 2b32edf..91e4c1d 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
@@ -525,8 +525,8 @@
private void unmanageDryRun(final Entity e) {
final ManagementTransitionInfo info = new ManagementTransitionInfo(managementContext,
ManagementTransitionMode.transitioning(BrooklynObjectManagementMode.NONEXISTENT, BrooklynObjectManagementMode.NONEXISTENT));
+ log.debug("Unmanaging "+e+" (dry run)");
discardPremanaged(e);
-
((EntityInternal)e).getManagementSupport().onManagementStopping(info, true);
stopTasks(e);
((EntityInternal)e).getManagementSupport().onManagementStopped(info, true);
@@ -535,6 +535,7 @@
private void unmanage(final Entity e, ManagementTransitionMode mode, boolean hasBeenReplaced) {
if (shouldSkipUnmanagement(e, hasBeenReplaced)) return;
final ManagementTransitionInfo info = new ManagementTransitionInfo(managementContext, mode);
+ log.debug("Unmanaging "+e+" (mode "+mode+", replaced "+hasBeenReplaced+")");
if (hasBeenReplaced) {
// we are unmanaging an old instance after having replaced it
// don't unmanage or even clear its fields, because there might be references to it