guilherme-dsantos commented on code in PR #3292:
URL: https://github.com/apache/amoro/pull/3292#discussion_r1812651347


##########
amoro-ams/src/main/java/org/apache/amoro/server/table/TableRuntime.java:
##########
@@ -611,11 +611,14 @@ public String toString() {
   public long getQuotaTime() {
     long calculatingEndTime = System.currentTimeMillis();
     long calculatingStartTime = calculatingEndTime - 
AmoroServiceConstants.QUOTA_LOOK_BACK_TIME;
-    taskQuotas.removeIf(task -> task.checkExpired(calculatingStartTime));
-    long finishedTaskQuotaTime =
-        taskQuotas.stream()
-            .mapToLong(taskQuota -> 
taskQuota.getQuotaTime(calculatingStartTime))
-            .sum();
+    long finishedTaskQuotaTime;
+    synchronized (taskQuotas) {

Review Comment:
   Thank you for the opportunity. I've updated the code to use 
CopyOnWriteArrayList.



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