mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 04:58:50 +00:00
If we fail to create the `FileChannelReference` (e.g. because the directory it should be created in was deleted in a test) we have to remove the listener from the `listeners` set to not trip internal consistency assertions. Relates #65302 (does not fix it though, but reduces noise from failures by removing secondary tripped assertions after the test fails)
This commit is contained in:
parent
67b6317488
commit
b0cea04f95
@ -138,12 +138,12 @@ public class CacheFile {
|
|||||||
try {
|
try {
|
||||||
synchronized (listeners) {
|
synchronized (listeners) {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
final boolean added = listeners.add(listener);
|
if (listeners.isEmpty()) {
|
||||||
assert added : "listener already exists " + listener;
|
|
||||||
if (listeners.size() == 1) {
|
|
||||||
assert channelRef == null;
|
assert channelRef == null;
|
||||||
channelRef = new FileChannelReference();
|
channelRef = new FileChannelReference();
|
||||||
}
|
}
|
||||||
|
final boolean added = listeners.add(listener);
|
||||||
|
assert added : "listener already exists " + listener;
|
||||||
}
|
}
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user