mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Close channel associated with lock
Fix Windows build issue where .lock file cannot be deleted due to underling channel associated with lock not being closed. This will stop the file from being deleted until the JVM exits, despite reporting through Java that the file *has* been deleted and does not exist. It also blocks new files from being created with the same filename, which caused the test failure here. Fixes #7822
This commit is contained in:
parent
ee725806ad
commit
9da03c5e9e
1 changed files with 6 additions and 1 deletions
|
@ -146,7 +146,12 @@ public final class DeadLetterQueueWriter implements Closeable {
|
|||
|
||||
@Override
|
||||
public synchronized void close() throws IOException {
|
||||
this.lock.release();
|
||||
if (this.lock != null){
|
||||
this.lock.release();
|
||||
if (this.lock.channel() != null && this.lock.channel().isOpen()) {
|
||||
this.lock.channel().close();
|
||||
}
|
||||
}
|
||||
if (currentWriter != null) {
|
||||
currentWriter.close();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue