You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/08/11 05:26:27 UTC

[GitHub] [inlong] woofyzhao opened a new pull request, #5477: [INLONG-5476][Manager] Fix heartbeat status problem

woofyzhao opened a new pull request, #5477:
URL: https://github.com/apache/inlong/pull/5477

   
   - Fixes #5476
   
   1. the cache remove cause should be filtered
   2. should use cleanup to do eager eviction in time 
   https://github.com/ben-manes/caffeine/wiki/Cleanup
   
   <img width="1016" alt="image" src="https://user-images.githubusercontent.com/941634/184069431-bf255e3c-d0b9-4fdc-8076-ed4ee53d8061.png">
   This is exactly the case of heartbeat scenario
   


-- 
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@inlong.apache.org

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


[GitHub] [inlong] dockerzhang merged pull request #5477: [INLONG-5476][Manager] Fix heartbeat status and node list query problem

Posted by GitBox <gi...@apache.org>.
dockerzhang merged PR #5477:
URL: https://github.com/apache/inlong/pull/5477


-- 
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@inlong.apache.org

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


[GitHub] [inlong] woofyzhao commented on a diff in pull request #5477: [INLONG-5476][Manager] Fix heartbeat status and node list query problem

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5477:
URL: https://github.com/apache/inlong/pull/5477#discussion_r944059746


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/heartbeat/HeartbeatManager.java:
##########
@@ -66,16 +68,18 @@ public class HeartbeatManager implements AbstractHeartbeatManager {
     @PostConstruct
     public void init() {
         long expireTime = heartbeatInterval() * 2L;
+        Scheduler evictScheduler = Scheduler.forScheduledExecutorService(Executors.newSingleThreadScheduledExecutor());
         heartbeatCache = Caffeine.newBuilder()
+                .scheduler(evictScheduler)
                 .expireAfterAccess(expireTime, TimeUnit.SECONDS)
                 .removalListener((ComponentHeartbeat k, HeartbeatMsg msg, RemovalCause c) -> {
-                    if (msg != null) {
+                    if ((c.wasEvicted() || c == RemovalCause.EXPLICIT) && msg != null) {
                         evictClusterNode(msg);
                     }
                 }).build();
 
         clusterInfoCache = Caffeine.newBuilder()
-                .expireAfterAccess(expireTime, TimeUnit.SECONDS)
+                .expireAfterAccess(expireTime * 2L, TimeUnit.SECONDS)

Review Comment:
   Why double again, needs explanation.



-- 
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@inlong.apache.org

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