Ap-95671 commented on code in PR #31305:
URL: https://github.com/apache/camel/pull/31305#discussion_r4816192398


##########
components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/cluster/InfinispanEmbeddedClusterView.java:
##########
@@ -169,11 +174,13 @@ protected void doStart() throws Exception {
 
             cache.addListener(this);
 
+            long periodMillis = Math.max(1,
+                    
configuration.getLifespanTimeUnit().toMillis(configuration.getLifespan()) / 2);

Review Comment:
   Could we keep sub-millisecond precision when computing the heartbeat? 
`setLifespan(1000)` plus `setLifespanTimeUnit(MICROSECONDS)` gives the cache a 
1 ms lease. On JDK 21 the old call schedules every 500 µs, while this code 
schedules every 1 ms. That leaves no margin before lease expiry, so scheduler 
delay can let the leader or membership entry expire. The service metadata still 
accepts `MICROSECONDS` and promises a half-lifespan refresh. Computing half the 
lease with finer precision before clamping it to a positive period would 
preserve this case. A captured-scheduler assertion on the actual cluster view 
would cover it.
   
   _OpenAI Codex on behalf of @Ap-95671_



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to