You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/08/18 18:36:46 UTC
[GitHub] jvrao commented on a change in pull request #1414: Ensure
BufferedChannel instance is properly closed
jvrao commented on a change in pull request #1414: Ensure BufferedChannel instance is properly closed
URL: https://github.com/apache/bookkeeper/pull/1414#discussion_r211083004
##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java
##########
@@ -86,8 +87,13 @@ public BufferedChannel(FileChannel fc, int writeCapacity, int readCapacity, long
}
@Override
- public void close() throws IOException {
- writeBuffer.release();
+ public synchronized void close() throws IOException {
+ if (writeBuffer != null) {
+ ReferenceCountUtil.safeRelease(writeBuffer);
+ writeBuffer = null;
Review comment:
Thanks @merlimat calling twice is an issue and we should address that. :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services