Skip to content

Commit

Permalink
Fix for S3PartitionCreatorScheduler ConcurrentModification Exception (o…
Browse files Browse the repository at this point in the history
…pensearch-project#4473)

* Fix for S3PartitionCreatorScheduler ConcurrentModification Exception

Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com>

* Remove warn log message

Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com>

---------

Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com>
  • Loading branch information
dinujoh authored Apr 29, 2024
1 parent 7a5e687 commit 23cf021
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;

Expand Down Expand Up @@ -46,12 +47,14 @@ public void run() {
break;
}

collections.forEach(collection -> {
final Iterator<String> iterator = collections.iterator();
while(iterator.hasNext()) {
final String collection = iterator.next();
final Optional<S3PartitionStatus> s3PartitionStatus = getGlobalS3FolderCreationStatus(collection);
if (s3PartitionStatus.isPresent()) {
collections.remove(collection);
iterator.remove();
}
});
}

if (collections.isEmpty()) {
LOG.info("The S3 folder partition global state created for all collections.");
Expand All @@ -68,7 +71,6 @@ public void run() {
}
}
}
LOG.warn("S3 partition creator scheduler interrupted, looks like shutdown has triggered");
}

private List<String> createS3BucketPartitions(int partitionCount) {
Expand Down

0 comments on commit 23cf021

Please sign in to comment.