jiajunwang commented on a change in pull request #367: Add transient cache for 
CustomRestClient implementation
URL: https://github.com/apache/helix/pull/367#discussion_r309568879
 
 

 ##########
 File path: 
helix-rest/src/main/java/org/apache/helix/rest/client/CustomRestClientImpl.java
 ##########
 @@ -97,7 +111,17 @@ public CustomRestClientImpl(HttpClient httpClient) {
           kv -> result.put(kv.getKey(), 
kv.getValue().get(IS_HEALTHY_FIELD).asBoolean()));
       return result;
     };
-    return handleResponse(post(url, payLoads), jsonConverter);
+    try {
+      // use semaphore to allow X threads to submit HttpRequests at a time
+      // without thread synchronization, duplicate http requests will still 
exist
 
 Review comment:
   > duplicate http requests will still exist
   
   So is there another way of preventing this completely? 
   I might be lack of context here, but the current method limits parallelism 
for dedup, right? Meaning we will limit the threads even system has enough 
resource. This is not a scalable solution.
   Can we use a concurrent map to hold all the in-progress query with some key 
and avoid the queries with the same keys to dedup?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to