Skip to content

Commit

Permalink
[AMORO-3286] Fix ConcurrentModificationException in TableRuntime.getQ…
Browse files Browse the repository at this point in the history
…uotaTime() (#3292)

* Fix ConcurrentModificationException in TableRuntime.getQuotaTime()

* Fix ConcurrentModificationException using CopyOnWriteArrayList

---------

Co-authored-by: gsantos <gsantos@fedora.home>
  • Loading branch information
guilherme-dsantos and gsantos authored Oct 25, 2024
1 parent e54fbc2 commit 1057139
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,19 @@

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CopyOnWriteArrayList;

public class TableRuntime extends StatedPersistentBase {

private static final Logger LOG = LoggerFactory.getLogger(TableRuntime.class);

private final TableRuntimeHandler tableHandler;
private final ServerTableIdentifier tableIdentifier;
private final List<TaskRuntime.TaskQuota> taskQuotas =
Collections.synchronizedList(new ArrayList<>());
private final List<TaskRuntime.TaskQuota> taskQuotas = new CopyOnWriteArrayList<>();

// for unKeyedTable or base table
@StateField private volatile long currentSnapshotId = AmoroServiceConstants.INVALID_SNAPSHOT_ID;
Expand Down

0 comments on commit 1057139

Please sign in to comment.