Skip to content

Commit 5061954

Browse files
authored
Fix race condition in SnapshotsService (#101652) (#101688)
* Fix race condition in SnapshotsService * Update docs/changelog/101652.yaml
1 parent 38d3db5 commit 5061954

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/changelog/101652.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 101652
2+
summary: Fix race condition in `SnapshotsService`
3+
area: Snapshot/Restore
4+
type: bug
5+
issues: []

server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public class SnapshotsService extends AbstractLifecycleComponent implements Clus
175175
/**
176176
* Listeners for snapshot deletion keyed by delete uuid as returned from {@link SnapshotDeletionsInProgress.Entry#uuid()}
177177
*/
178-
private final Map<String, List<ActionListener<Void>>> snapshotDeletionListeners = new HashMap<>();
178+
private final Map<String, List<ActionListener<Void>>> snapshotDeletionListeners = new ConcurrentHashMap<>();
179179

180180
// Set of repositories currently running either a snapshot finalization or a snapshot delete.
181181
private final Set<String> currentlyFinalizing = Collections.synchronizedSet(new HashSet<>());

0 commit comments

Comments
 (0)