mirror of https://github.com/apache/lucene.git
LUCENE-3709: properly release primary output lock if wrapper creation fails
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1234398 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
af9b4d816f
commit
acf9e1333d
|
@ -255,10 +255,8 @@ final class CompoundFileWriter implements Closeable{
|
|||
assert !seenIDs.contains(id): "file=\"" + name + "\" maps to id=\"" + id + "\", which was already written";
|
||||
seenIDs.add(id);
|
||||
final DirectCFSIndexOutput out;
|
||||
if (outputTaken.compareAndSet(false, true)) {
|
||||
if ((outputLocked = outputTaken.compareAndSet(false, true))) {
|
||||
out = new DirectCFSIndexOutput(getOutput(), entry, false);
|
||||
outputLocked = true;
|
||||
success = true;
|
||||
} else {
|
||||
entry.dir = this.directory;
|
||||
if (directory.fileExists(name)) {
|
||||
|
|
Loading…
Reference in New Issue