Add try catch for unlock call

This commit is contained in:
Manfred Karrer 2017-07-16 15:55:51 +02:00
parent bbacd09074
commit b5db7fc557

View File

@ -498,12 +498,14 @@ public class Connection implements MessageListener {
log.error("Exception at shutdown. " + e.getMessage());
e.printStackTrace();
} finally {
if (protoOutputStreamLock.isLocked())
protoOutputStreamLock.unlock();
try {
if (protoOutputStreamLock.isLocked())
protoOutputStreamLock.unlock();
} catch (Throwable ignore) {
}
try {
protoOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
} catch (Throwable ignore) {
}
MoreExecutors.shutdownAndAwaitTermination(singleThreadExecutor, 500, TimeUnit.MILLISECONDS);