Skip to content

Commit

Permalink
Preserve context in snapshotDeletionListeners (elastic#84089)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveCTurner authored and probakowski committed Feb 23, 2022
1 parent 48da74f commit 1fa4427
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/changelog/84089.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 84089
summary: Preserve context in `snapshotDeletionListeners`
area: Snapshot/Restore
type: bug
issues:
- 84036
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,8 @@ private static boolean isWritingToRepository(SnapshotsInProgress.Entry entry) {
}

private void addDeleteListener(String deleteUUID, ActionListener<Void> listener) {
snapshotDeletionListeners.computeIfAbsent(deleteUUID, k -> new CopyOnWriteArrayList<>()).add(listener);
snapshotDeletionListeners.computeIfAbsent(deleteUUID, k -> new CopyOnWriteArrayList<>())
.add(ContextPreservingActionListener.wrapPreservingContext(listener, threadPool.getThreadContext()));
}

/**
Expand Down

0 comments on commit 1fa4427

Please sign in to comment.