You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "chengyouling (via GitHub)" <gi...@apache.org> on 2023/03/23 06:02:16 UTC

[GitHub] [servicecomb-java-chassis] chengyouling opened a new pull request, #3726: [SCB-2771]fix MicroserviceVersions concurrent access problem

chengyouling opened a new pull request, #3726:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3726

   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean install -Pit` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] liubao68 closed pull request #3726: [SCB-2771]fix MicroserviceVersions concurrent access problem

Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 closed pull request #3726: [SCB-2771]fix MicroserviceVersions concurrent access problem
URL: https://github.com/apache/servicecomb-java-chassis/pull/3726


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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


[GitHub] [servicecomb-java-chassis] liubao68 commented on a diff in pull request #3726: [SCB-2771]fix MicroserviceVersions concurrent access problem

Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on code in PR #3726:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3726#discussion_r1153968161


##########
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java:
##########
@@ -109,13 +110,18 @@ public String getMicroserviceName() {
     return microserviceName;
   }
 
+  @VisibleForTesting
   public Map<String, MicroserviceVersion> getVersions() {
-    return versions;
+    synchronized (lock) {
+      return versions;
+    }
   }
 
   @SuppressWarnings("unchecked")
   public <T extends MicroserviceVersion> T getVersion(String serviceId) {
-    return (T) versions.get(serviceId);
+    synchronized (lock) {
+      return (T) versions.get(serviceId);

Review Comment:
   1.3.x do not clear version when set instances, is this modification necessary and can you reproduce the problem?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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