From 605c80a68def2e09eb8d4d0632eb646108f287bd Mon Sep 17 00:00:00 2001 From: mposolda Date: Fri, 16 Oct 2015 20:50:48 +0200 Subject: [PATCH] KEYCLOAK-1952 Migration fix. Change some INFO messages to DEBUG/TRACE --- .../resources/META-INF/jpa-changelog-1.6.0.xml | 2 +- .../InfinispanUserSessionInitializer.java | 16 ++++++++-------- .../infinispan/initializer/InitializerState.java | 3 +-- .../initializer/OfflineUserSessionLoader.java | 8 ++++---- .../initializer/SessionInitializerWorker.java | 5 +++-- .../src/test/resources/log4j.properties | 3 +++ 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.6.0.xml b/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.6.0.xml index 3d5b99f1ab..5b0a0da893 100644 --- a/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.6.0.xml +++ b/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.6.0.xml @@ -3,7 +3,7 @@ - + diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/InfinispanUserSessionInitializer.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/InfinispanUserSessionInitializer.java index 89f2d4f56a..b368fd3811 100644 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/InfinispanUserSessionInitializer.java +++ b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/InfinispanUserSessionInitializer.java @@ -161,13 +161,13 @@ public class InfinispanUserSessionInitializer { int nodesCount = transport==null ? 1 : transport.getMembers().size(); int distributedWorkersCount = processors * nodesCount; - // TODO: debug - log.infof("Starting next iteration with %d workers", distributedWorkersCount); + log.debugf("Starting next iteration with %d workers", distributedWorkersCount); List segments = state.getUnfinishedSegments(distributedWorkersCount); - // TODO: trace - log.info("unfinished segments for this iteration: " + segments); + if (log.isTraceEnabled()) { + log.trace("unfinished segments for this iteration: " + segments); + } List> futures = new LinkedList<>(); for (Integer segment : segments) { @@ -205,8 +205,9 @@ public class InfinispanUserSessionInitializer { saveStateToCache(state); - // TODO - log.info("New initializer state pushed. The state is: " + state.printState()); + if (log.isDebugEnabled()) { + log.debug("New initializer state pushed. The state is: " + state.printState()); + } } } finally { distributedExecutorService.shutdown(); @@ -235,8 +236,7 @@ public class InfinispanUserSessionInitializer { @ViewChanged public void viewChanged(ViewChangedEvent event) { boolean isCoordinator = isCoordinator(); - // TODO: debug - log.info("View Changed: is coordinator: " + isCoordinator); + log.debug("View Changed: is coordinator: " + isCoordinator); if (isCoordinator) { latch.countDown(); diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/InitializerState.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/InitializerState.java index 6066077779..1381c19283 100644 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/InitializerState.java +++ b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/InitializerState.java @@ -26,8 +26,7 @@ public class InitializerState extends SessionEntity { segmentsCount = segmentsCount + 1; } - // TODO: debug - log.infof("sessionsCount: %d, sessionsPerSegment: %d, segmentsCount: %d", sessionsCount, sessionsPerSegment, segmentsCount); + log.debugf("sessionsCount: %d, sessionsPerSegment: %d, segmentsCount: %d", sessionsCount, sessionsPerSegment, segmentsCount); for (int i=0 ; i sessions = persister.loadUserSessions(first, max, true); diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/SessionInitializerWorker.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/SessionInitializerWorker.java index 98fa69ec97..c9c204b466 100644 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/SessionInitializerWorker.java +++ b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/initializer/SessionInitializerWorker.java @@ -38,8 +38,9 @@ public class SessionInitializerWorker implements DistributedCallable