Skip to content

Commit 6535363

Browse files
volodk85DaveCTurner
authored andcommitted
Fix race condition in SnapshotsService (#101652)
* Fix race condition in SnapshotsService * Update docs/changelog/101652.yaml
1 parent a454116 commit 6535363

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
@@ -162,7 +162,7 @@ public class SnapshotsService extends AbstractLifecycleComponent implements Clus
162162
/**
163163
* Listeners for snapshot deletion keyed by delete uuid as returned from {@link SnapshotDeletionsInProgress.Entry#uuid()}
164164
*/
165-
private final Map<String, List<ActionListener<Void>>> snapshotDeletionListeners = new HashMap<>();
165+
private final Map<String, List<ActionListener<Void>>> snapshotDeletionListeners = new ConcurrentHashMap<>();
166166

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

0 commit comments

Comments
 (0)