xiangfu0 commented on code in PR #17234:
URL: https://github.com/apache/pinot/pull/17234#discussion_r2549190602
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/ReloadJobStatus.java:
##########
@@ -18,22 +18,26 @@
*/
package org.apache.pinot.segment.local.utils;
+import java.util.ArrayList;
+import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.pinot.common.response.server.SegmentReloadFailureResponse;
/**
* Tracks status of a reload job.
- * Phase 1: Only tracks failure count.
*/
public class ReloadJobStatus {
private final String _jobId;
private final AtomicInteger _failureCount;
private final long _createdTimeMs;
+ private final List<SegmentReloadFailureResponse> _failedSegmentDetails;
public ReloadJobStatus(String jobId) {
_jobId = jobId;
_failureCount = new AtomicInteger(0);
_createdTimeMs = System.currentTimeMillis();
+ _failedSegmentDetails = new ArrayList<>();
Review Comment:
We recently saw a lot of ConcurrentModificationException during list
iteration. When there is other threads trying to modify the list(add/delete)
I think for `_failedSegmentDetails`,
Either make it a thread-safe collection (e.g., Collections.synchronizedList
or CopyOnWriteArrayList)
Or that all access (both reads and writes) is properly synchronized on the
ReloadJobStatus object, which means you provide APIs to modify the
`_failedSegmentDetails`
This getter should strictly return an immutable view (e.g.,
Collections.unmodifiableList()).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]