mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Queue: fix unlock mutex on close()
On o.l.ackedqueue.Queue.close() method the lock.unlock() call might not execute, leaving a mutex locked. This change ensure that lock.unlock() is always execute by moving its call to the sibling try/catch's finally block.
This commit is contained in:
parent
42166f3d52
commit
009a8bd571
1 changed files with 2 additions and 1 deletions
|
@ -668,8 +668,9 @@ public class Queue implements Closeable {
|
|||
} catch (IOException e) {
|
||||
// log error and ignore
|
||||
logger.error("Queue close releaseLock failed, error={}", e.getMessage());
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue