SzyWilliam commented on code in PR #15014:
URL: https://github.com/apache/iotdb/pull/15014#discussion_r2000829716
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/detector/PhiAccrualDetector.java:
##########
@@ -61,17 +65,25 @@ public PhiAccrualDetector(
this.minHeartbeatStdNs = minHeartbeatStdNs;
this.codeStartSampleCount = minimalSampleCount;
this.fallbackDuringColdStart = fallbackDuringColdStart;
+ this.availibilityCache =
+ CacheBuilder.newBuilder().expireAfterAccess(5,
TimeUnit.MINUTES).build();
}
@Override
- public boolean isAvailable(List<AbstractHeartbeatSample> history) {
+ public boolean isAvailable(Object Id, List<AbstractHeartbeatSample> history)
{
+ /* We are copying this history to avoid concurrent modification. */
+ final List<AbstractHeartbeatSample> historyCopy = new ArrayList<>(history);
Review Comment:
Good catch, fixed.
--
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]