This is an automated email from the ASF dual-hosted git repository.
stefanegli pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-oak.git
The following commit(s) were added to refs/heads/master by this push:
new 2636d75 Sling 12853 -- Changes to fix SlingIdCleanupTask throws
ConcurrentModificationException (#17)
2636d75 is described below
commit 2636d75f10f53a25ca9f5bd28b6ec5186c569b3e
Author: ionutzpi <[email protected]>
AuthorDate: Mon Jul 14 14:31:53 2025 +0300
Sling 12853 -- Changes to fix SlingIdCleanupTask throws
ConcurrentModificationException (#17)
---
src/main/java/org/apache/sling/discovery/oak/SlingIdCleanupTask.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/src/main/java/org/apache/sling/discovery/oak/SlingIdCleanupTask.java
b/src/main/java/org/apache/sling/discovery/oak/SlingIdCleanupTask.java
index fb51070..7094cec 100644
--- a/src/main/java/org/apache/sling/discovery/oak/SlingIdCleanupTask.java
+++ b/src/main/java/org/apache/sling/discovery/oak/SlingIdCleanupTask.java
@@ -24,6 +24,7 @@ import java.util.Calendar;
import java.util.Date;
import java.util.Set;
import java.util.UUID;
+import java.util.HashSet;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@@ -462,7 +463,7 @@ public class SlingIdCleanupTask implements
TopologyEventListener, Runnable {
}
// if we're not already at the batch limit, check syncTokens too
if (!mightHaveMore) {
- for (String slingId : syncTokenMap.keySet()) {
+ for (String slingId : new HashSet<>(syncTokenMap.keySet())) {
try {
UUID.fromString(slingId);
} catch (Exception e) {