You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by GitBox <gi...@apache.org> on 2020/05/20 14:56:13 UTC

[GitHub] [sling-org-apache-sling-distribution-journal] cschneider opened a new pull request #28: SLING-9460 - Avoid seeding messages in PubQueueCache

cschneider opened a new pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/28


   All tests in journal pass. I did not yet check in real env or in it tests.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-distribution-journal] sonarcloud[bot] commented on pull request #28: SLING-9460 - Avoid seeding messages in PubQueueCache

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/28#issuecomment-632842460


   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B.png' alt='B' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60.png' alt='89.7%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_coverage&view=list) [89.7% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-distribution-journal] sonarcloud[bot] removed a comment on pull request #28: SLING-9460 - Avoid seeding messages in PubQueueCache

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/28#issuecomment-631528971


   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B.png' alt='B' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60.png' alt='89.7%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_coverage&view=list) [89.7% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-distribution-journal] cschneider commented on a change in pull request #28: SLING-9460 - Avoid seeding messages in PubQueueCache

Posted by GitBox <gi...@apache.org>.
cschneider commented on a change in pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/28#discussion_r429397500



##########
File path: src/main/java/org/apache/sling/distribution/journal/impl/publisher/DiscoveryService.java
##########
@@ -151,12 +157,14 @@ public void handle(MessageInfo info, DiscoveryMessage disMsg) {
 
             long now = System.currentTimeMillis();
             AgentId subAgentId = new AgentId(disMsg.getSubSlingId(), disMsg.getSubAgentName());
-
+            long minOffset = 0;
             for (Messages.SubscriberState subStateMsg : disMsg.getSubscriberStateList()) {
                 SubscriberConfiguration subConfig = disMsg.getSubscriberConfiguration();
                 State subState = new State(subStateMsg.getPubAgentName(), subAgentId.getAgentId(), now, subStateMsg.getOffset(), subStateMsg.getRetries(), subConfig.getMaxRetries(), subConfig.getEditable());
                 viewManager.refreshState(subState);
+                minOffset = Math.min(minOffset, subState.getOffset());

Review comment:
       Fixed it .. WDYT?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-distribution-journal] tmaret commented on a change in pull request #28: SLING-9460 - Avoid seeding messages in PubQueueCache

Posted by GitBox <gi...@apache.org>.
tmaret commented on a change in pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/28#discussion_r429546002



##########
File path: src/main/java/org/apache/sling/distribution/journal/impl/publisher/DiscoveryService.java
##########
@@ -151,12 +157,14 @@ public void handle(MessageInfo info, DiscoveryMessage disMsg) {
 
             long now = System.currentTimeMillis();
             AgentId subAgentId = new AgentId(disMsg.getSubSlingId(), disMsg.getSubAgentName());
-
+            long minOffset = 0;
             for (Messages.SubscriberState subStateMsg : disMsg.getSubscriberStateList()) {
                 SubscriberConfiguration subConfig = disMsg.getSubscriberConfiguration();
                 State subState = new State(subStateMsg.getPubAgentName(), subAgentId.getAgentId(), now, subStateMsg.getOffset(), subStateMsg.getRetries(), subConfig.getMaxRetries(), subConfig.getEditable());
                 viewManager.refreshState(subState);
+                minOffset = Math.min(minOffset, subState.getOffset());

Review comment:
       LGTM, thanks @cschneider ! Would you merge it ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-distribution-journal] tmaret commented on a change in pull request #28: SLING-9460 - Avoid seeding messages in PubQueueCache

Posted by GitBox <gi...@apache.org>.
tmaret commented on a change in pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/28#discussion_r428115589



##########
File path: src/main/java/org/apache/sling/distribution/journal/impl/publisher/DiscoveryService.java
##########
@@ -151,12 +157,14 @@ public void handle(MessageInfo info, DiscoveryMessage disMsg) {
 
             long now = System.currentTimeMillis();
             AgentId subAgentId = new AgentId(disMsg.getSubSlingId(), disMsg.getSubAgentName());
-
+            long minOffset = 0;
             for (Messages.SubscriberState subStateMsg : disMsg.getSubscriberStateList()) {
                 SubscriberConfiguration subConfig = disMsg.getSubscriberConfiguration();
                 State subState = new State(subStateMsg.getPubAgentName(), subAgentId.getAgentId(), now, subStateMsg.getOffset(), subStateMsg.getRetries(), subConfig.getMaxRetries(), subConfig.getEditable());
                 viewManager.refreshState(subState);
+                minOffset = Math.min(minOffset, subState.getOffset());

Review comment:
       There's a bug smell here. The minOffset will always be 0 since we get the `min`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-distribution-journal] sonarcloud[bot] commented on pull request #28: SLING-9460 - Avoid seeding messages in PubQueueCache

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/28#issuecomment-631528971


   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B.png' alt='B' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60.png' alt='89.7%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_coverage&view=list) [89.7% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=28&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-distribution-journal] cschneider merged pull request #28: SLING-9460 - Avoid seeding messages in PubQueueCache

Posted by GitBox <gi...@apache.org>.
cschneider merged pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/28


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org