You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:26:42 UTC

[sling-org-apache-sling-discovery-commons] annotated tag org.apache.sling.discovery.commons-1.0.10 created (now 804b464)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git.


      at 804b464  (tag)
 tagging c09a74961a78264be9d90b35127df6d8bdd1c190 (commit)
      by Stefan Egli
      on Thu Jan 28 12:53:08 2016 +0000

- Log -----------------------------------------------------------------
org.apache.sling.discovery.commons-1.0.10
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new b8fe30c  SLING-4665 : adding patch provided by Timothee Maret, many thanks
     new 7eadb24  svn:ignore updated
     new 5943189  SLING-4685 : adding initial version of ViewStateManager - a shared implementation of TopologyEventListener-handling and sending of events based on activate/deactivate/changing/newView triggers - intended for use by implementors of the discovery.api (not clients of it)
     new f438f9e  SLING-4698 - Set parent.relativePath to empty for all modules
     new 576bc0d  Update svn:ignore
     new f93b193  Update to Sling Parent 23
     new 0035b7d  set parent version to 24 and add empty relativePath where missing
     new e599fa8  Update the main reactor to parent 25
     new 9a31ba9  SLING-5131 : introducing ConsistencyService and an oak-discovery-lite based implementation of it - plus SLING-4697 : support for PROPERTIES_CHANGED added to ViewStateManagerImpl
     new b33eee0  SLING-5131 : re-adding ViewStateManager which for some reason got removed by svn in 1707548
     new bb3d20d  SLING-4697 : support for PROPERTIES_CHANGED in ViewStateManagerImpl tested and thus fixed
     new 0e44e3d  SLING-5173 : introducing discovery.base which is the sharable parts of discovery.impl for discovery.oak - eg it includes topology connectors and base classes - plus it also includes many it-kind tests of discovery.impl
     new 3d923b4  SLING-5173 : rename commons impl packages to base as they are meant for reuse by discovery.impl and discovery.oak - plus avoid using abstract component class with scr annotations - use abstract getters instead - plus some more fine-tuning of log messages - plus make discovery.impl's Config also implement DiscoveryLiteConfig - plus properly handle binds happening before activate in DiscoveryServiceImpl
     new 6dd90e1  SLING-5173 : adding refactored SyncTokenOnlyConsistencyService again
     new dd9150c  SLING-4603 related : some fixes in class structure / syncToken handling
     new cf6bb53  SLING-5173 related : EventFactory renamed to EventHelper - and introduced toShortString() for a few base view classes to shorten and make the log output more readable
     new dcfc44f  SLING-5173 and SLING-4603 related : more syncToken log.info - plus always doing the syncToken thingy, independent of whether any instance left or joined the cluster as otherwise this thing wont work
     new 81a52c9  SLING-5173 : log.info fix
     new 8b4c590  SLING-5094 / SLING-4603 related : cancel ongoing sync explicitly in order to avoid dangerous CHANGED event when changes happen during sync
     new f957528  SLING-5173 : reducing visibility of isDelaying
     new 732f4d6  SLING-5173 : reduce log in cancel when already done
     new e88458a  SLING-4603 : more aggressively clearing the idMap-cache to avoid stale entries on slingId change - plus added getSyncHistory to BaseSyncTokenConsistencyService to allow adding it to the webconsole for debug - plus some cleanup in webconsole wrt discoveryLite info
     new 36ac966  SLING-5173 : introducing a more explicit chain concept for ConsistencyServices than the previous hidden/implicit one: ConsistencyServiceChain
     new 1a36029  SLING-5173 : added simple implementation for findInstances
     new 8d22485  SLING-5173 : added getInstance(slingId) to simplify things
     new 6dd354e  SLING-5173 : introducing a more explicit chain concept for ConsistencyServices than the previous hidden/implicit one: ConsistencyServiceChain
     new df6d865  SLING-5173 : bugfix for leader changes: leader change was treated as a properties change - which was very bad - now it is properly treated as a TOPOLOGY_CHANGED. Note that leader change should not happen in an otherwise unchanged topology - but it can if one instance's discovery.oak bundle for example is restarted, thus getting a lower leaderElectionId. Thus discovery.commons must account for this
     new 3edba1a  SLING-5173 : re-added complete consistency-history after introducing splitting them and using the ConsistencyServiceChain. Probably should be refactored into something slightly nicer though
     new 05027b8  SLING-5173 : minor code cleanup (duplicate logger removed)
     new 2e5938f  SLING-4603 : even more aggressively clearing the idMap-cache to avoid stale entries : now registering an EventHandler that listens on /var/discovery/../idMap and clears the cache on any change therein
     new 11a225d  SLING-4603 : minor fix to previous commit : turns out the path must be /var/xy/idMap not /var/xy/idMap/* as that would apply to children only
     new 5a5f5ee  SLING-5094 / SLING-5173 / SLING-4603 related : ensure that before invoking the ConsistencyService.sync no async events are still in the queue. This is achieved by enqueueing an async event too that once it gets triggered ensures that no async events are left. This mechanism ensures that before the syncToken is written, all TopologyEventListeners have received a TOPOLOGY_CHANGING - and only that guarantees that the syncToken mechanism carries a high guarantee.
     new 26e1a7b  SLING-5094 / SLING-5173 / SLING-4603 related : ensure that before invoking the ConsistencyService.sync no async events are still in the queue. This is achieved by enqueueing an async event too that once it gets triggered ensures that no async events are left. This mechanism ensures that before the syncToken is written, all TopologyEventListeners have received a TOPOLOGY_CHANGING - and only that guarantees that the syncToken mechanism carries a high guarantee.
     new fc2a805  SLING-5191 / SLING-4603 : rename ConsistencyService to ClusterSyncService - plus making timeout/interval values for the same configurable in discovery.oak
     new 032f500  SLING-5094 related : more test stability by adding a wait time of 2sec
     new e5ded77  SLING-5094 / SLING-5191 / SLING-4603 : rename ConsistencyService to ClusterSyncService
     new fdd2176  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.0
     new 1df7dc1  [maven-release-plugin] prepare for next development iteration
     new 283f6b9  SLING-5214: include millis in testing log formats
     new 5c5f5e8  SLING-5225 : increase wait times to avoid test failure on jenkins due to lower hardware speed
     new 9dcf468  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.2
     new a5144bc  [maven-release-plugin] prepare for next development iteration
     new d71490a  SLING-5256 : change in localClusterSyncTokenId should always trigger a TOPOLOGY_CHANGED - ensured by adjusting ViewStateManager.onlyDiffersInProperties and DefaultTopologyView.compareTopology accordingly including new tests for both - plus added OakDiscoveryServiceTest.testDescriptorSeqNumChange to verify that discovery.oak now properly detects otherwise-equal topologies when their sequence_number==localClusterSyncTokenId differs (unlikely to happen under normal load sit [...]
     new 0f3c5c8  no-jira : fixed a log.trace message
     new 3529e4f  SLING-5267 : fixed testTwoNodesOneLeaving by making wait times safer, asserting for background-runnable done-state, plus added more logging in case this one is still not perfectly stable on jenkins
     new 8f8aedf  SLING-5282 : calling consistencyService.cancelSync(); in handleDeactivated
     new 7571e2f  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.4
     new 1cc2db6  [maven-release-plugin] prepare for next development iteration
     new dbdcc68  SLING-5310: adding cancelDelaying to MinEventDelayHandler - plus added a testReactivate test method which checks the scenario described in this ticket. Plus also added somewhat more logging to the HeartbeatHandler to help debugging should something similar reoccur
     new ca87b3d  SLING-5310 : replaced waitForAsyncEvents(4sec) with Thread.sleep(4sec) then another waitForAsyncEvents(2sec) to avoid making the assertion just when the event would yet be triggered
     new be1c2b7  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.6
     new 51fd2d4  [maven-release-plugin] prepare for next development iteration
     new 4830188  Remove type from bundle dependencies
     new ea02b02  Switch to parent pom 26
     new 8cb4867  SLING-5458 : id can now be null - return null in getViewId in that case
     new c664312  SLING-5458 : when clusterView.getId differs, that must result in a TOPOLOGY_CHANGING/CHANGED sequence - unlike before this fix where it just resulted in a PROPERTIES_CHANGED - which is wrong
     new c29e93e  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.8
     new ccce69b  [maven-release-plugin] prepare for next development iteration
     new 8468d76  SLING-5464 : fixed regression introduced in onlyDiffersInProperties - and added a proper JUnit test which would have avoided the problem in the first place
     new 6d303d2  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.10
     new c09a749  [maven-release-plugin] copy for tag org.apache.sling.discovery.commons-1.0.10

The 61 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-discovery-commons] 14/24: [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.6

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit be1c2b75f6fd3c2d136018ce5dc02956c32619d7
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Nov 25 13:18:02 2015 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.6
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1716378 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7df5485..96a1824 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.5-SNAPSHOT</version>
+    <version>1.0.6</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.6</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.6</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.6</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 11/24: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 1cc2db688e9af287c2dfb2e134da9dfe87c045c8
Author: Stefan Egli <st...@apache.org>
AuthorDate: Tue Nov 10 16:18:51 2015 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1713679 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index ca9d828..7df5485 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.4</version>
+    <version>1.0.5-SNAPSHOT</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.4</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.4</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.4</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 01/24: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 1df7dc1d878ef10a3bedbd3a37bc8cb4cc814ae4
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Oct 26 16:10:50 2015 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1710644 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index d32437c..34b03a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.0</version>
+    <version>1.0.1-SNAPSHOT</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 05/24: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit a5144bc801b1dbb2151b03ccba7ad99fa9b85a01
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Nov 2 15:53:23 2015 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1712053 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index a81f78b..23440eb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.2</version>
+    <version>1.0.3-SNAPSHOT</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.2</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.2</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.2</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 07/24: no-jira : fixed a log.trace message

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 0f3c5c871450a43a8f58097258f7da924c3ff77d
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Nov 4 17:05:31 2015 +0000

    no-jira : fixed a log.trace message
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1712590 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/discovery/commons/providers/base/AsyncTopologyEvent.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/base/AsyncTopologyEvent.java b/src/main/java/org/apache/sling/discovery/commons/providers/base/AsyncTopologyEvent.java
index 4d2a443..3cb472b 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/base/AsyncTopologyEvent.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/base/AsyncTopologyEvent.java
@@ -54,7 +54,7 @@ final class AsyncTopologyEvent implements AsyncEvent {
         } catch(final Exception e) {
             logger.warn("trigger: handler threw exception. handler: "+listener+", exception: "+e, e);
         }
-        logger.trace("trigger: start: listener: {}, event: {}", listener, event);
+        logger.trace("trigger: end: listener: {}, event: {}", listener, event);
     }
 
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 22/24: SLING-5464 : fixed regression introduced in onlyDiffersInProperties - and added a proper JUnit test which would have avoided the problem in the first place

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 8468d76eec3dfa0b2d7446171f98c600fd42e3b1
Author: Stefan Egli <st...@apache.org>
AuthorDate: Thu Jan 28 12:44:40 2016 +0000

    SLING-5464 : fixed regression introduced in onlyDiffersInProperties - and added a proper JUnit test which would have avoided the problem in the first place
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1727323 13f79535-47bb-0310-9956-ffa450edef68
---
 .../providers/base/ViewStateManagerImpl.java       |  2 +-
 .../providers/base/TestViewStateManager.java       | 33 ++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
index 6757912..b9f9fc7 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
@@ -633,7 +633,7 @@ public class ViewStateManagerImpl implements ViewStateManager {
             if (oldInstance.isLeader() != newInstance.isLeader()) {
                 return false;
             }
-            if (oldInstance.getClusterView().getId() != newInstance.getClusterView().getId()) {
+            if (!oldInstance.getClusterView().getId().equals(newInstance.getClusterView().getId())) {
                 return false;
             }
         }
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java
index e7cbcc5..4e73bc7 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java
@@ -32,7 +32,11 @@ import java.util.concurrent.locks.ReentrantLock;
 
 import org.apache.log4j.Level;
 import org.apache.log4j.LogManager;
+import org.apache.sling.discovery.ClusterView;
+import org.apache.sling.discovery.DiscoveryService;
+import org.apache.sling.discovery.InstanceDescription;
 import org.apache.sling.discovery.TopologyEvent;
+import org.apache.sling.discovery.TopologyView;
 import org.apache.sling.discovery.commons.providers.BaseTopologyView;
 import org.apache.sling.discovery.commons.providers.DefaultClusterView;
 import org.apache.sling.discovery.commons.providers.DefaultInstanceDescription;
@@ -131,6 +135,35 @@ public class TestViewStateManager {
     }
     
     @Test
+    public void testChangedPropertiesChanged() throws Exception {
+        final DummyListener listener = new DummyListener();
+        mgr.installMinEventDelayHandler(new DiscoveryService() {
+            
+            @Override
+            public TopologyView getTopology() {
+                throw new IllegalStateException("not yet impl");
+            }
+        }, new DummyScheduler(), 1);
+        mgr.handleActivated();
+        TestHelper.assertNoEvents(listener);
+        mgr.bind(listener);
+        TestHelper.assertNoEvents(listener);
+        mgr.handleChanging();
+        TestHelper.assertNoEvents(listener);
+        final BaseTopologyView view1 = new DummyTopologyView().addInstance();
+        InstanceDescription instance1 = view1.getInstances().iterator().next();
+        ClusterView cluster1 = instance1.getClusterView();
+        mgr.handleNewView(view1);
+        assertEvents(listener, EventHelper.newInitEvent(view1));
+        DefaultClusterView cluster2 = new DefaultClusterView(new String(cluster1.getId()));
+        final BaseTopologyView view2 = new DummyTopologyView(view1.getLocalClusterSyncTokenId()).addInstance(instance1.getSlingId(), cluster2, instance1.isLeader(), instance1.isLocal());
+        DefaultInstanceDescription instance2 = (DefaultInstanceDescription) view2.getLocalInstance();
+        instance2.setProperty("foo", "bar");
+        mgr.handleNewView(view2);
+        assertEvents(listener, EventHelper.newPropertiesChangedEvent(view1, view2));
+    }
+
+    @Test
     public void testDuplicateListeners() throws Exception {
         final DummyListener listener = new DummyListener();
         mgr.bind(listener);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 12/24: SLING-5310: adding cancelDelaying to MinEventDelayHandler - plus added a testReactivate test method which checks the scenario described in this ticket. Plus also added somewhat more logging to the HeartbeatHandler to help debugging should something similar reoccur

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit dbdcc687bd7a67ed53aa6628df6c751340cf3b23
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Nov 18 12:12:21 2015 +0000

    SLING-5310: adding cancelDelaying to MinEventDelayHandler - plus added a testReactivate test method which checks the scenario described in this ticket. Plus also added somewhat more logging to the HeartbeatHandler to help debugging should something similar reoccur
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1714984 13f79535-47bb-0310-9956-ffa450edef68
---
 .../providers/base/MinEventDelayHandler.java       | 14 ++++
 .../providers/base/ViewStateManagerImpl.java       |  4 ++
 .../providers/base/TestMinEventDelayHandler.java   | 77 +++++++++++++++++++++-
 3 files changed, 93 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/base/MinEventDelayHandler.java b/src/main/java/org/apache/sling/discovery/commons/providers/base/MinEventDelayHandler.java
index a8a0066..167a0ba 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/base/MinEventDelayHandler.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/base/MinEventDelayHandler.java
@@ -49,6 +49,8 @@ class MinEventDelayHandler {
 
     private Lock lock;
     
+    private volatile int cancelCnt = 0;
+    
     MinEventDelayHandler(ViewStateManagerImpl viewStateManager, Lock lock,
             DiscoveryService discoveryService, Scheduler scheduler,
             long minEventDelaySecs) {
@@ -117,11 +119,17 @@ class MinEventDelayHandler {
     }
     
     private boolean triggerAsyncDelaying(BaseTopologyView newView) {
+        final int validCancelCnt = cancelCnt;
         final boolean triggered = runAfter(minEventDelaySecs /*seconds*/ , new Runnable() {
     
             public void run() {
                 lock.lock();
                 try{
+                    if (cancelCnt!=validCancelCnt) {
+                        logger.info("asyncDelay.run: got cancelled (validCancelCnt="+validCancelCnt+", cancelCnt="+cancelCnt+"), quitting.");
+                        return;
+                    }
+                    
                     // unlock the CHANGED event for any subsequent call to handleTopologyChanged()
                     isDelaying = false;
 
@@ -192,4 +200,10 @@ class MinEventDelayHandler {
         return isDelaying;
     }
 
+    public void cancelDelaying() {
+        logger.info("cancelDelaying: flagging cancelCnt as invalid: "+cancelCnt);
+        cancelCnt++;
+        isDelaying = false;
+    }
+
 }
diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
index 53cfbff..b6bff61 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
@@ -336,6 +336,10 @@ public class ViewStateManagerImpl implements ViewStateManager {
             if (consistencyService!=null) {
                 consistencyService.cancelSync();
             }
+            
+            if (minEventDelayHandler!=null) {
+                minEventDelayHandler.cancelDelaying();
+            }
             logger.trace("handleDeactivated: setting isChanging to false");
             isChanging = false;
             
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java
index fc78c44..002fc7e 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java
@@ -20,7 +20,9 @@ package org.apache.sling.discovery.commons.providers.base;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 
+import java.lang.reflect.Field;
 import java.util.Random;
 import java.util.UUID;
 import java.util.concurrent.locks.ReentrantLock;
@@ -86,11 +88,82 @@ public class TestMinEventDelayHandler {
         discoveryLogger.setLevel(logLevel);
     }
     
+    
+    @Test
+    public void testReactivate() throws Exception {
+        logger.info("testReactivate: start");
+        // install a minEventDelayHandler with a longer delay of 2sec
+        mgr.installMinEventDelayHandler(sds, scheduler, 2);
+
+        final DummyListener listener = new DummyListener();
+        logger.info("testReactivate: calling handleActivated");
+        mgr.bind(listener);
+        mgr.handleActivated();
+        TestHelper.assertNoEvents(listener);
+        final DummyTopologyView view1 = new DummyTopologyView().addInstance();
+        final DummyTopologyView view2 = DummyTopologyView.clone(view1).addInstance(UUID.randomUUID().toString(), 
+                (DefaultClusterView) view1.getLocalInstance().getClusterView(), false, false);
+        final DummyTopologyView view3 = DummyTopologyView.clone(view1).addInstance(UUID.randomUUID().toString(), 
+                (DefaultClusterView) view1.getLocalInstance().getClusterView(), false, false);
+        logger.info("testReactivate: calling handleNewView...");
+        mgr.handleNewView(view1);
+        logger.info("testReactivate: asserting init event");
+        TestHelper.assertEvents(mgr, listener, EventHelper.newInitEvent(view1));
+        logger.info("testReactivate: calling handleChanging...");
+        mgr.handleChanging();
+        TestHelper.assertEvents(mgr, listener, EventHelper.newChangingEvent(view1));
+        logger.info("testReactivate: calling handleNewView 2nd time...");
+        mgr.handleNewView(view2);
+        TestHelper.assertNoEvents(listener);
+        // make sure the MinEventDelayHandler finds a topology when coming back from the delaying, so:
+        sds.setTopoology(view2);
+        logger.info("testReactivate: waiting for async events to have been processed - max 4sec");
+        assertEquals(0, mgr.waitForAsyncEvents(4000));
+        logger.info("testReactivate: asserting CHANGED event");
+        TestHelper.assertEvents(mgr, listener, EventHelper.newChangedEvent(view1, view2));
+        
+        // now do the above again, but this time do a handleDeactivated before receiving another changed event
+        logger.info("testReactivate: calling handleChanging...");
+        mgr.handleChanging();
+        TestHelper.assertEvents(mgr, listener, EventHelper.newChangingEvent(view2));
+        logger.info("testReactivate: calling handleNewView 2nd time...");
+        mgr.handleNewView(view3);
+        TestHelper.assertNoEvents(listener);
+        // make sure the MinEventDelayHandler finds a topology when coming back from the delaying, so:
+        sds.setTopoology(view3);
+        
+        logger.info("testReactivate: doing handleDeactivated");
+        final AsyncEventSender asyncEventSender = mgr.getAsyncEventSender();
+        Field field = mgr.getClass().getDeclaredField("minEventDelayHandler");
+        field.setAccessible(true);
+        MinEventDelayHandler minEventDelayHandler = (MinEventDelayHandler) field.get(mgr);
+        assertNotNull(minEventDelayHandler);
+        
+        // marking view3 as not current
+        view3.setNotCurrent();
+        sds.setTopoology(view3);
+        
+        mgr.handleDeactivated();
+        TestHelper.assertNoEvents(listener);
+        
+        logger.info("testReactivate: now waiting 5 sec to make sure the MinEventDelayHandler would be finished");
+        TestHelper.assertNoEvents(listener);
+        Thread.sleep(5000);
+        logger.info("testReactivate: after those 5 sec there should however still not be any new event");
+        TestHelper.assertNoEvents(listener);
+
+        int cnt = asyncEventSender.getInFlightEventCnt();
+        if (minEventDelayHandler!=null && minEventDelayHandler.isDelaying()) {
+            cnt++;
+        }
+        assertEquals(0, cnt);
+    }
+
     private void assertNoEvents(DummyListener listener) {
         assertEquals(0, listener.countEvents());
     }
 
-    @Test @Ignore
+    @Test
     public void testNormalDelaying() throws Exception {
         final DummyListener listener = new DummyListener();
         // first activate
@@ -115,7 +188,7 @@ public class TestMinEventDelayHandler {
         }
     }
 
-    @Test @Ignore
+    @Test
     public void testFailedDelaying() throws Exception {
         scheduler.failMode();
         final DummyListener listener = new DummyListener();

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 03/24: SLING-5225 : increase wait times to avoid test failure on jenkins due to lower hardware speed

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 5c5f5e82622336c3582e5a5f4ac6e20d75dcffb5
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Nov 2 09:11:15 2015 +0000

    SLING-5225 : increase wait times to avoid test failure on jenkins due to lower hardware speed
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1711917 13f79535-47bb-0310-9956-ffa450edef68
---
 .../commons/providers/spi/base/TestOakSyncTokenService.java  | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java
index b90c622..726dd95 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java
@@ -134,7 +134,7 @@ public class TestOakSyncTokenService {
         assertEquals(0, l.countEvents());
         cs.triggerBackgroundCheck();
         DescriptorHelper.setDiscoveryLiteDescriptor(factory1, new DiscoveryLiteDescriptorBuilder().me(1).seq(1).activeIds(1).setFinal(true));
-        assertTrue(idMapService1.waitForInit(2000));
+        assertTrue(idMapService1.waitForInit(5000));
         cs.triggerBackgroundCheck();
         assertEquals(0, vsm.waitForAsyncEvents(1000));
         assertEquals(1, l.countEvents());
@@ -175,15 +175,15 @@ public class TestOakSyncTokenService {
         cs2.triggerBackgroundCheck();
         assertEquals(0, l.countEvents());
         vsm2.handleActivated();
-        assertTrue(idMapService1.waitForInit(2000));
-        assertTrue(idMapService2.waitForInit(2000));
+        assertTrue(idMapService1.waitForInit(5000));
+        assertTrue(idMapService2.waitForInit(5000));
         DummyTopologyView two2 = TestHelper.newView(two1.getLocalClusterSyncTokenId(), two1.getLocalInstance().getClusterView().getId(), true, slingId1, slingId1, slingId1, slingId2);
         vsm2.handleNewView(two2);
         cs1.triggerBackgroundCheck();
         cs1.triggerBackgroundCheck();
         cs2.triggerBackgroundCheck();
         cs2.triggerBackgroundCheck();
-        assertEquals(0, vsm1.waitForAsyncEvents(500));
+        assertEquals(0, vsm1.waitForAsyncEvents(1000));
         assertEquals(1, l.countEvents());
         DummyTopologyView oneLeaving = two1.clone();
         oneLeaving.removeInstance(slingId2);
@@ -191,12 +191,12 @@ public class TestOakSyncTokenService {
         vsm1.handleNewView(oneLeaving);
         cs1.triggerBackgroundCheck();
         cs2.triggerBackgroundCheck();
-        assertEquals(0, vsm1.waitForAsyncEvents(2000));
+        assertEquals(0, vsm1.waitForAsyncEvents(5000));
         assertEquals(2, l.countEvents());
         DescriptorHelper.setDiscoveryLiteDescriptor(factory1, new DiscoveryLiteDescriptorBuilder().setFinal(true).me(1).seq(2).activeIds(1).inactiveIds(2));
         cs1.triggerBackgroundCheck();
         cs2.triggerBackgroundCheck();
-        assertEquals(0, vsm1.waitForAsyncEvents(2000));
+        assertEquals(0, vsm1.waitForAsyncEvents(5000));
         RepositoryTestHelper.dumpRepo(factory1);
         assertEquals(3, l.countEvents());
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 18/24: SLING-5458 : id can now be null - return null in getViewId in that case

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 8cb48674e6e0e8589b93807ecf5785dd131098e5
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Jan 27 15:16:57 2016 +0000

    SLING-5458 : id can now be null - return null in getViewId in that case
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1727084 13f79535-47bb-0310-9956-ffa450edef68
---
 .../commons/providers/spi/base/DiscoveryLiteDescriptor.java        | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java
index 906ab27..9ec862d 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java
@@ -110,9 +110,14 @@ public class DiscoveryLiteDescriptor {
      * @throws Exception if anything in the descriptor is wrongly formatted
      */
     public String getViewId() throws Exception {
+        if (descriptor.isNull("id")) {
+            // SLING-5458 : id can now be null,
+            // so treat this separately and return null here too
+            return null;
+        }
         Object idObj = descriptor.get("id");
         if (idObj == null || !(idObj instanceof String)) {
-            throw new Exception("getMe: 'me' value of descriptor not a String: "+idObj+" (descriptor: "+descriptor+")");
+            throw new Exception("getViewId: 'id' value of descriptor not a String: "+idObj+" (descriptor: "+descriptor+")");
         }
         return String.valueOf(idObj);
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 06/24: SLING-5256 : change in localClusterSyncTokenId should always trigger a TOPOLOGY_CHANGED - ensured by adjusting ViewStateManager.onlyDiffersInProperties and DefaultTopologyView.compareTopology accordingly including new tests for both - plus added OakDiscoveryServiceTest.testDescriptorSeqNumChange to verify that discovery.oak now properly detects otherwise-equal topologies when their sequence_number==localClusterSyncTokenId differs (unlikely to happen under normal load situations though)

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit d71490a407dc42fd96ab6a6f08b3c1b87b3a9a11
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Nov 4 10:37:59 2015 +0000

    SLING-5256 : change in localClusterSyncTokenId should always trigger a TOPOLOGY_CHANGED - ensured by adjusting ViewStateManager.onlyDiffersInProperties and DefaultTopologyView.compareTopology accordingly including new tests for both - plus added OakDiscoveryServiceTest.testDescriptorSeqNumChange to verify that discovery.oak now properly detects otherwise-equal topologies when their sequence_number==localClusterSyncTokenId differs (unlikely to happen under normal load situations though)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1712527 13f79535-47bb-0310-9956-ffa450edef68
---
 .../providers/base/ViewStateManagerImpl.java       |  17 ++++
 .../commons/providers/DummyTopologyView.java       |  11 ++-
 .../providers/base/TestViewStateManager.java       | 100 ++++++++++++++++++++-
 3 files changed, 125 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
index 5930022..e5c4e4b 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
@@ -589,6 +589,23 @@ public class ViewStateManagerImpl implements ViewStateManager {
         if (newView==null) {
             throw new IllegalArgumentException("newView must not be null");
         }
+        String previousSyncTokenId = null;
+        String newSyncTokenId = null;
+        try{
+            previousSyncTokenId = previousView.getLocalClusterSyncTokenId();
+        } catch(IllegalStateException re) {
+            previousSyncTokenId = null;
+        }
+        try{
+            newSyncTokenId = newView.getLocalClusterSyncTokenId();
+        } catch(IllegalStateException re) {
+            newSyncTokenId = null;
+        }
+        if ((previousSyncTokenId == null && newSyncTokenId != null)
+                || (newSyncTokenId == null && previousSyncTokenId != null)
+                || (previousSyncTokenId!=null && !previousSyncTokenId.equals(newSyncTokenId))) {
+            return false;
+        }
         if (previousView.getInstances().size()!=newView.getInstances().size()) {
             return false;
         }
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/DummyTopologyView.java b/src/test/java/org/apache/sling/discovery/commons/providers/DummyTopologyView.java
index b5314ad..e12b24d 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/DummyTopologyView.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/DummyTopologyView.java
@@ -35,7 +35,7 @@ public class DummyTopologyView extends BaseTopologyView {
 
     private List<InstanceDescription> instances = new LinkedList<InstanceDescription>();
 
-    private final String id;
+    private String id;
 
     public DummyTopologyView() {
         id = UUID.randomUUID().toString();
@@ -45,6 +45,10 @@ public class DummyTopologyView extends BaseTopologyView {
         this.id = id;
     }
     
+    public void setId(String id) {
+        this.id = id;
+    }
+    
     @Override
     public boolean equals(Object obj) {
         if (!(obj instanceof DummyTopologyView)) {
@@ -54,7 +58,9 @@ public class DummyTopologyView extends BaseTopologyView {
         if (this==other) {
             return true;
         }
-        if (!id.equals(other.id)) {
+        if ((id == null && other.id != null)
+                || (other.id == null && id != null)
+                || (id != null && !id.equals(other.id))) {
             return false;
         }
         if (this.instances.size()!=other.instances.size()) {
@@ -212,4 +218,5 @@ public class DummyTopologyView extends BaseTopologyView {
     public DummyTopologyView clone() {
         return DummyTopologyView.clone(this);
     }
+
 }
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java
index 048b0cd..e7cbcc5 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java
@@ -86,6 +86,8 @@ public class TestViewStateManager {
     
     private Random defaultRandom;
 
+    private Level logLevel;
+
     @Before
     public void setup() throws Exception {
         mgr = new ViewStateManagerImpl(new ReentrantLock(), new ClusterSyncService() {
@@ -100,6 +102,9 @@ public class TestViewStateManager {
             }
         });
         defaultRandom = new Random(1234123412); // I want randomness yes, but deterministic, for some methods at least
+        final org.apache.log4j.Logger discoveryLogger = LogManager.getRootLogger().getLogger("org.apache.sling.discovery");
+        logLevel = discoveryLogger.getLevel();
+        discoveryLogger.setLevel(Level.INFO);
     }
     
     @After
@@ -110,6 +115,8 @@ public class TestViewStateManager {
         }
         mgr = null;
         defaultRandom= null;
+        final org.apache.log4j.Logger discoveryLogger = LogManager.getRootLogger().getLogger("org.apache.sling.discovery");
+        discoveryLogger.setLevel(logLevel);
     }
     
     void assertEvents(DummyListener listener, TopologyEvent... events) {
@@ -683,4 +690,95 @@ public class TestViewStateManager {
         commonsLogger.setLevel(Level.INFO); // back to default
     }
 
-}
+    @Test
+    public void testOnlyDiffersInProperties() throws Exception {
+        final org.apache.log4j.Logger discoveryLogger = LogManager.getRootLogger().getLogger("org.apache.sling.discovery");
+        discoveryLogger.setLevel(Level.DEBUG);
+        logger.info("testOnlyDiffersInProperties: start");
+        final String slingId1 = UUID.randomUUID().toString();
+        final String slingId2 = UUID.randomUUID().toString();
+        final String slingId3 = UUID.randomUUID().toString();
+        final String clusterId = UUID.randomUUID().toString();
+        final DefaultClusterView cluster = new DefaultClusterView(clusterId);
+        final DummyTopologyView view1 = new DummyTopologyView()
+                .addInstance(slingId1, cluster, true, true)
+                .addInstance(slingId2, cluster, false, false)
+                .addInstance(slingId3, cluster, false, false);
+        final DummyTopologyView view2 = DummyTopologyView.clone(view1).removeInstance(slingId2);
+        final DummyTopologyView view3 = DummyTopologyView.clone(view1).removeInstance(slingId2).removeInstance(slingId3);
+        DummyTopologyView view1Cloned = DummyTopologyView.clone(view1);
+        
+        logger.info("testOnlyDiffersInProperties: handleNewView(view1)");
+        mgr.handleNewView(view1);
+        logger.info("testOnlyDiffersInProperties: handleActivated()");
+        mgr.handleActivated();
+        assertEquals(0, mgr.waitForAsyncEvents(5000));
+        assertFalse(mgr.onlyDiffersInProperties(view1));
+        assertFalse(mgr.onlyDiffersInProperties(view2));
+        assertFalse(mgr.onlyDiffersInProperties(view3));
+        logger.info("testOnlyDiffersInProperties: handleNewView(view2)");
+        mgr.handleNewView(view2);
+        assertEquals(0, mgr.waitForAsyncEvents(5000));
+        assertFalse(mgr.onlyDiffersInProperties(view1));
+        assertFalse(mgr.onlyDiffersInProperties(view2));
+        assertFalse(mgr.onlyDiffersInProperties(view3));
+        logger.info("testOnlyDiffersInProperties: handleNewView(view3)");
+        mgr.handleNewView(view3);
+        assertEquals(0, mgr.waitForAsyncEvents(5000));
+        assertFalse(mgr.onlyDiffersInProperties(view1));
+        assertFalse(mgr.onlyDiffersInProperties(view2));
+        assertFalse(mgr.onlyDiffersInProperties(view3));
+
+        final DummyTopologyView view4 = DummyTopologyView.clone(view1Cloned);
+        final DummyTopologyView view5 = DummyTopologyView.clone(view1Cloned);
+        final DummyTopologyView view6 = DummyTopologyView.clone(view1Cloned);
+        logger.info("testOnlyDiffersInProperties: handleNewView(view1cloned)");
+        mgr.handleNewView(view1Cloned);
+        assertEquals(0, mgr.waitForAsyncEvents(5000));
+        DefaultInstanceDescription i4_1 = (DefaultInstanceDescription) view4.getInstance(slingId1);
+        i4_1.setProperty("a", "b");
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view4)");
+        assertTrue(mgr.onlyDiffersInProperties(view4));
+    
+        DefaultInstanceDescription i5_1 = (DefaultInstanceDescription) view5.getInstance(slingId1);
+        i5_1.setProperty("a", "b");
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view5)");
+        assertTrue(mgr.onlyDiffersInProperties(view5));
+        DummyTopologyView view4Cloned = DummyTopologyView.clone(view4);
+        mgr.handleNewView(view4);
+        assertEquals(0, mgr.waitForAsyncEvents(5000));
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view4Cloned)");
+        assertFalse(mgr.onlyDiffersInProperties(view4Cloned));
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view5)");
+        assertFalse(mgr.onlyDiffersInProperties(view5));
+
+        DefaultInstanceDescription i6_1 = (DefaultInstanceDescription) view6.getInstance(slingId1);
+        i6_1.setProperty("a", "c");
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view6)");
+        assertTrue(mgr.onlyDiffersInProperties(view6));
+        String originalId = view6.getLocalClusterSyncTokenId();
+        view6.setId(UUID.randomUUID().toString());
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view6) [2]");
+        assertFalse(mgr.onlyDiffersInProperties(view6));
+        view6.setId(originalId);
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view6) [3]");
+        assertTrue(mgr.onlyDiffersInProperties(view6));
+        view6.setId(null);
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view6) [4]");
+        assertFalse(mgr.onlyDiffersInProperties(view6));
+        view6.setId(originalId);
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view6) [5]");
+        assertTrue(mgr.onlyDiffersInProperties(view6));
+        
+        // hack: we're modifying the view *in the ViewStateManagerImpl* here!!:
+        view4.setId(null);
+
+        view6.setId(null);
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view6) [6]");
+        assertTrue(mgr.onlyDiffersInProperties(view6));
+        view6.setId(originalId);
+        logger.info("testOnlyDiffersInProperties: onlyDiffersInProperties(view6) [7]");
+        assertFalse(mgr.onlyDiffersInProperties(view6));
+    }
+
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 16/24: Remove type from bundle dependencies

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 4830188c2c697c9caaa517a9418853fbc15ae49a
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Dec 21 11:05:09 2015 +0000

    Remove type from bundle dependencies
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1721125 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 70c4c34..b074e09 100644
--- a/pom.xml
+++ b/pom.xml
@@ -194,14 +194,12 @@
         	<groupId>org.apache.jackrabbit</groupId>
         	<artifactId>jackrabbit-jcr-commons</artifactId>
         	<version>2.11.0</version>
-        	<type>bundle</type>
         	<scope>test</scope>
         </dependency>
         <dependency>
         	<groupId>org.apache.jackrabbit</groupId>
         	<artifactId>jackrabbit-api</artifactId>
         	<version>2.11.0</version>
-        	<type>bundle</type>
         	<scope>test</scope>
         </dependency>
 		<dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 20/24: [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.8

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit c29e93e8a0aa3ec4adf1768e2c2bc1e6ff63d63e
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Jan 27 15:32:22 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.8
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1727088 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 60b0cd0..97739c4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.7-SNAPSHOT</version>
+    <version>1.0.8</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.8</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.8</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.8</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 19/24: SLING-5458 : when clusterView.getId differs, that must result in a TOPOLOGY_CHANGING/CHANGED sequence - unlike before this fix where it just resulted in a PROPERTIES_CHANGED - which is wrong

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit c664312942ae065afb965edb2e0a570ff2b038fb
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Jan 27 15:17:48 2016 +0000

    SLING-5458 : when clusterView.getId differs, that must result in a TOPOLOGY_CHANGING/CHANGED sequence - unlike before this fix where it just resulted in a PROPERTIES_CHANGED - which is wrong
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1727085 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/discovery/commons/providers/base/ViewStateManagerImpl.java   | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
index b6bff61..6757912 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
@@ -633,6 +633,9 @@ public class ViewStateManagerImpl implements ViewStateManager {
             if (oldInstance.isLeader() != newInstance.isLeader()) {
                 return false;
             }
+            if (oldInstance.getClusterView().getId() != newInstance.getClusterView().getId()) {
+                return false;
+            }
         }
         return true;
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 08/24: SLING-5267 : fixed testTwoNodesOneLeaving by making wait times safer, asserting for background-runnable done-state, plus added more logging in case this one is still not perfectly stable on jenkins

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 3529e4f60899739eaa94ecb2e22e7fce9eb2f364
Author: Stefan Egli <st...@apache.org>
AuthorDate: Thu Nov 5 11:03:07 2015 +0000

    SLING-5267 : fixed testTwoNodesOneLeaving by making wait times safer, asserting for background-runnable done-state, plus added more logging in case this one is still not perfectly stable on jenkins
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1712742 13f79535-47bb-0310-9956-ffa450edef68
---
 .../base/AbstractServiceWithBackgroundCheck.java   |  8 +++-
 .../spi/base/OakBacklogClusterSyncService.java     |  3 +-
 .../spi/base/TestOakSyncTokenService.java          | 53 +++++++++++++++++++---
 3 files changed, 56 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/AbstractServiceWithBackgroundCheck.java b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/AbstractServiceWithBackgroundCheck.java
index 29088b1..84f2f76 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/AbstractServiceWithBackgroundCheck.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/AbstractServiceWithBackgroundCheck.java
@@ -37,7 +37,7 @@ public abstract class AbstractServiceWithBackgroundCheck {
      * calling BackgroundCheck.check and looping until it 
      * returns true
      */
-    private final class BackgroundCheckRunnable implements Runnable {
+    final class BackgroundCheckRunnable implements Runnable {
         private final Runnable callback;
         private final BackgroundCheck check;
         private final long timeoutMillis;
@@ -61,6 +61,12 @@ public abstract class AbstractServiceWithBackgroundCheck {
             this.waitInterval = waitInterval;
             this.threadName = threadName;
         }
+        
+        boolean isDone() {
+            synchronized(waitObj) {
+                return done;
+            }
+        }
 
         @Override
         public void run() {
diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/OakBacklogClusterSyncService.java b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/OakBacklogClusterSyncService.java
index fa07268..8fbe1cb 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/OakBacklogClusterSyncService.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/OakBacklogClusterSyncService.java
@@ -18,6 +18,7 @@
  */
 package org.apache.sling.discovery.commons.providers.spi.base;
 
+import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -207,7 +208,7 @@ public class OakBacklogClusterSyncService extends AbstractServiceWithBackgroundC
             
             // 1) 'deactivating' must be empty 
             if (deactivatingIds.length!=0) {
-                logger.info("getBacklogStatus: there are deactivating instances: "+deactivatingIds);
+                logger.info("getBacklogStatus: there are deactivating instances: "+Arrays.toString(deactivatingIds));
                 return BacklogStatus.HAS_BACKLOG;
             }
 
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java
index 726dd95..e767571 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/TestOakSyncTokenService.java
@@ -19,6 +19,8 @@
 package org.apache.sling.discovery.commons.providers.spi.base;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.util.UUID;
@@ -32,16 +34,18 @@ import org.apache.sling.discovery.commons.providers.ViewStateManager;
 import org.apache.sling.discovery.commons.providers.base.DummyListener;
 import org.apache.sling.discovery.commons.providers.base.TestHelper;
 import org.apache.sling.discovery.commons.providers.base.ViewStateManagerFactory;
-import org.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteConfig;
-import org.apache.sling.discovery.commons.providers.spi.base.IdMapService;
-import org.apache.sling.discovery.commons.providers.spi.base.OakBacklogClusterSyncService;
+import org.apache.sling.discovery.commons.providers.spi.base.AbstractServiceWithBackgroundCheck.BackgroundCheckRunnable;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class TestOakSyncTokenService {
 
+    private final static Logger logger = LoggerFactory.getLogger(TestOakSyncTokenService.class);
+
     private static final String SYNCTOKEN_PATH = "/var/discovery/commons/synctokens";
 
     private static final String IDMAP_PATH = "/var/discovery/commons/idmap";
@@ -92,6 +96,7 @@ public class TestOakSyncTokenService {
     
     @Before
     public void setup() throws Exception {
+        logger.info("setup: start");
         RepositoryTestHelper.resetRepo();
         memoryNS = new MemoryNodeStore();
         repository1 = RepositoryTestHelper.newOakRepository(memoryNS);
@@ -101,10 +106,12 @@ public class TestOakSyncTokenService {
         factory2 = RepositoryTestHelper.mockResourceResolverFactory(repository2);
         slingId1 = UUID.randomUUID().toString();
         idMapService1 = IdMapService.testConstructor(new SimpleCommonsConfig(), new DummySlingSettingsService(slingId1), factory1);
+        logger.info("setup: end");
     }
     
     @After
     public void tearDown() throws Exception {
+        logger.info("teardown: start");
         if (repository1!=null) {
             RepositoryTestHelper.stopRepository(repository1);
             repository1 = null;
@@ -113,10 +120,12 @@ public class TestOakSyncTokenService {
             RepositoryTestHelper.stopRepository(repository2);
             repository2 = null;
         }
+        logger.info("teardown: end");
     }
     
     @Test
     public void testOneNode() throws Exception {
+        logger.info("testOneNode: start");
         DummyTopologyView one = TestHelper.newView(true, slingId1, slingId1, slingId1);
         Lock lock = new ReentrantLock();
         OakBacklogClusterSyncService cs = OakBacklogClusterSyncService.testConstructorAndActivate(new SimpleCommonsConfig(), idMapService1, new DummySlingSettingsService(slingId1), factory1);
@@ -138,10 +147,12 @@ public class TestOakSyncTokenService {
         cs.triggerBackgroundCheck();
         assertEquals(0, vsm.waitForAsyncEvents(1000));
         assertEquals(1, l.countEvents());
+        logger.info("testOneNode: end");
     }
     
     @Test
     public void testTwoNodesOneLeaving() throws Exception {
+        logger.info("testTwoNodesOneLeaving: start");
         String slingId2 = UUID.randomUUID().toString();
         DummyTopologyView two1 = TestHelper.newView(true, slingId1, slingId1, slingId1, slingId2);
         Lock lock1 = new ReentrantLock();
@@ -156,8 +167,32 @@ public class TestOakSyncTokenService {
         DescriptorHelper.setDiscoveryLiteDescriptor(factory1, new DiscoveryLiteDescriptorBuilder().setFinal(true).me(1).seq(1).activeIds(1).deactivatingIds(2));
         cs1.triggerBackgroundCheck();
         assertEquals(0, l.countEvents());
+        
+        // make an assertion that the background runnable is at this stage - even with
+        // a 2sec sleep - waiting for the deactivating instance to disappear
+        logger.info("testTwoNodesOneLeaving: sync service should be waiting for backlog to disappear");
+        Thread.sleep(2000);
+        BackgroundCheckRunnable backgroundCheckRunnable = cs1.backgroundCheckRunnable;
+        assertNotNull(backgroundCheckRunnable);
+        assertFalse(backgroundCheckRunnable.isDone());
+        assertFalse(backgroundCheckRunnable.cancelled());
+        
+        // release the deactivating instance by removing it from the clusterView
+        logger.info("testTwoNodesOneLeaving: freeing backlog - sync service should finish up");
         DescriptorHelper.setDiscoveryLiteDescriptor(factory1, new DiscoveryLiteDescriptorBuilder().setFinal(true).me(1).seq(2).activeIds(1));
         cs1.triggerBackgroundCheck();
+        
+        // now give this thing 2 sec to settle
+        Thread.sleep(2000);
+        
+        // after that, the backgroundRunnable should be done and no events stuck in vsm
+        backgroundCheckRunnable = cs1.backgroundCheckRunnable;
+        assertNotNull(backgroundCheckRunnable);
+        assertFalse(backgroundCheckRunnable.cancelled());
+        assertTrue(backgroundCheckRunnable.isDone());
+        assertEquals(0, vsm1.waitForAsyncEvents(1000));
+        
+        logger.info("testTwoNodesOneLeaving: setting up 2nd node");
         Lock lock2 = new ReentrantLock();
         IdMapService idMapService2 = IdMapService.testConstructor(
                 new SimpleCommonsConfig(), new DummySlingSettingsService(slingId2), factory2);
@@ -165,15 +200,15 @@ public class TestOakSyncTokenService {
         ViewStateManager vsm2 = ViewStateManagerFactory.newViewStateManager(lock2, cs2);
         cs1.triggerBackgroundCheck();
         cs2.triggerBackgroundCheck();
-        assertEquals(0, l.countEvents());
+        assertEquals(1, l.countEvents());
         DescriptorHelper.setDiscoveryLiteDescriptor(factory2, new DiscoveryLiteDescriptorBuilder().setFinal(true).me(2).seq(3).activeIds(1, 2));
         cs1.triggerBackgroundCheck();
         cs2.triggerBackgroundCheck();
-        assertEquals(0, l.countEvents());
+        assertEquals(1, l.countEvents());
         DescriptorHelper.setDiscoveryLiteDescriptor(factory1, new DiscoveryLiteDescriptorBuilder().setFinal(true).me(1).seq(3).activeIds(1, 2));
         cs1.triggerBackgroundCheck();
         cs2.triggerBackgroundCheck();
-        assertEquals(0, l.countEvents());
+        assertEquals(1, l.countEvents());
         vsm2.handleActivated();
         assertTrue(idMapService1.waitForInit(5000));
         assertTrue(idMapService2.waitForInit(5000));
@@ -185,17 +220,23 @@ public class TestOakSyncTokenService {
         cs2.triggerBackgroundCheck();
         assertEquals(0, vsm1.waitForAsyncEvents(1000));
         assertEquals(1, l.countEvents());
+        
+        logger.info("testTwoNodesOneLeaving: removing instance2 from the view - even though vsm1 didn't really know about it, it should send a TOPOLOGY_CHANGING - we leave it as deactivating for now...");
         DummyTopologyView oneLeaving = two1.clone();
         oneLeaving.removeInstance(slingId2);
         DescriptorHelper.setDiscoveryLiteDescriptor(factory1, new DiscoveryLiteDescriptorBuilder().setFinal(true).me(1).seq(1).activeIds(1).deactivatingIds(2));
         vsm1.handleNewView(oneLeaving);
         cs1.triggerBackgroundCheck();
         cs2.triggerBackgroundCheck();
+        // wait for TOPOLOGY_CHANGING to be received by vsm1
         assertEquals(0, vsm1.waitForAsyncEvents(5000));
         assertEquals(2, l.countEvents());
+
+        logger.info("testTwoNodesOneLeaving: marking instance2 as no longer deactivating, so vsm1 should now send a TOPOLOGY_CHANGED");
         DescriptorHelper.setDiscoveryLiteDescriptor(factory1, new DiscoveryLiteDescriptorBuilder().setFinal(true).me(1).seq(2).activeIds(1).inactiveIds(2));
         cs1.triggerBackgroundCheck();
         cs2.triggerBackgroundCheck();
+        // wait for TOPOLOGY_CHANGED to be received by vsm1
         assertEquals(0, vsm1.waitForAsyncEvents(5000));
         RepositoryTestHelper.dumpRepo(factory1);
         assertEquals(3, l.countEvents());

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 04/24: [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.2

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 9dcf468e4e3fff7388951eb91755fb1c7a48205e
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Nov 2 15:53:06 2015 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1712051 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 34b03a0..a81f78b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.1-SNAPSHOT</version>
+    <version>1.0.2</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.2</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.2</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.2</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 24/24: [maven-release-plugin] copy for tag org.apache.sling.discovery.commons-1.0.10

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit c09a74961a78264be9d90b35127df6d8bdd1c190
Author: Stefan Egli <st...@apache.org>
AuthorDate: Thu Jan 28 12:53:08 2016 +0000

    [maven-release-plugin] copy for tag org.apache.sling.discovery.commons-1.0.10
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.10@1727326 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 02/24: SLING-5214: include millis in testing log formats

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 283f6b9f7a301293a737c8eadce6886dfabf5963
Author: Stefan Egli <st...@apache.org>
AuthorDate: Thu Oct 29 12:34:37 2015 +0000

    SLING-5214: include millis in testing log formats
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1711236 13f79535-47bb-0310-9956-ffa450edef68
---
 src/test/resources/log4j.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/resources/log4j.properties b/src/test/resources/log4j.properties
index 7db291c..ec467a0 100644
--- a/src/test/resources/log4j.properties
+++ b/src/test/resources/log4j.properties
@@ -23,4 +23,4 @@ log4j.logger.org.apache.jackrabbit.core.TransientRepository=WARN
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 #log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L)\n
-log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m\n
+log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss.SSS} *%-5p* [%t] %c{1}: %m\n

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 15/24: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 51fd2d45b61985d1b3787d023ac0b00b4d8306c1
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Nov 25 13:18:21 2015 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1716380 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 96a1824..70c4c34 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.6</version>
+    <version>1.0.7-SNAPSHOT</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.6</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.6</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.6</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 09/24: SLING-5282 : calling consistencyService.cancelSync(); in handleDeactivated

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 8f8aedf23177df9b7b336b9bc26de7a4f094ddff
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Nov 9 13:59:24 2015 +0000

    SLING-5282 : calling consistencyService.cancelSync(); in handleDeactivated
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1713434 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/discovery/commons/providers/base/ViewStateManagerImpl.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
index e5c4e4b..53cfbff 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/base/ViewStateManagerImpl.java
@@ -332,6 +332,10 @@ public class ViewStateManagerImpl implements ViewStateManager {
                 logger.trace("handleDeactivated: setting previousView to null");
                 previousView = null;
             }
+            
+            if (consistencyService!=null) {
+                consistencyService.cancelSync();
+            }
             logger.trace("handleDeactivated: setting isChanging to false");
             isChanging = false;
             

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 10/24: [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.4

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 7571e2f902c3ec40fa9d7cc9c53b65c94d10e25b
Author: Stefan Egli <st...@apache.org>
AuthorDate: Tue Nov 10 16:18:34 2015 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.4
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1713676 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 23440eb..ca9d828 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.3-SNAPSHOT</version>
+    <version>1.0.4</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.4</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.4</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.4</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 17/24: Switch to parent pom 26

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit ea02b0200a7f73f5b8841a0a03884aa0f4350ca8
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Jan 3 14:07:46 2016 +0000

    Switch to parent pom 26
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1722720 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b074e09..60b0cd0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>25</version>
+        <version>26</version>
         <relativePath />
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 23/24: [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.10

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 6d303d205ae9c46ab09d967aa02171fcb438d379
Author: Stefan Egli <st...@apache.org>
AuthorDate: Thu Jan 28 12:52:55 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.10
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1727325 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2981f7e..0840706 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.9-SNAPSHOT</version>
+    <version>1.0.10</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.10</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.10</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.10</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 21/24: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit ccce69b0df2522f6d3ef083183bbda6c96057d3b
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Jan 27 15:32:41 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1727090 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 97739c4..2981f7e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.8</version>
+    <version>1.0.9-SNAPSHOT</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.8</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.8</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.8</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-discovery-commons] 13/24: SLING-5310 : replaced waitForAsyncEvents(4sec) with Thread.sleep(4sec) then another waitForAsyncEvents(2sec) to avoid making the assertion just when the event would yet be triggered

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit ca87b3df0653eb75ad6d2b2c0a1ec06e9c9f72c6
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Nov 18 16:34:00 2015 +0000

    SLING-5310 : replaced waitForAsyncEvents(4sec) with Thread.sleep(4sec) then another waitForAsyncEvents(2sec) to avoid making the assertion just when the event would yet be triggered
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1715019 13f79535-47bb-0310-9956-ffa450edef68
---
 .../discovery/commons/providers/base/TestMinEventDelayHandler.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java
index 002fc7e..0b868ea 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java
@@ -117,8 +117,10 @@ public class TestMinEventDelayHandler {
         TestHelper.assertNoEvents(listener);
         // make sure the MinEventDelayHandler finds a topology when coming back from the delaying, so:
         sds.setTopoology(view2);
-        logger.info("testReactivate: waiting for async events to have been processed - max 4sec");
-        assertEquals(0, mgr.waitForAsyncEvents(4000));
+        logger.info("testReactivate: waiting for async events to have been processed - 4sec");
+        Thread.sleep(4000);
+        logger.info("testReactivate: waiting for async events to have been processed - max another 2sec");
+        assertEquals(0, mgr.waitForAsyncEvents(2000));
         logger.info("testReactivate: asserting CHANGED event");
         TestHelper.assertEvents(mgr, listener, EventHelper.newChangedEvent(view1, view2));
         

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.