[
https://issues.apache.org/jira/browse/BOOKKEEPER-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050957#comment-13050957
]
Ivan Kelly commented on BOOKKEEPER-5:
-------------------------------------
Is the locking on the object the same as the locking in the netty thread you
posted?
I think the reason this patch works is that you call .awaitUninterruptibly() on
the channel group. You could just do awaitingUninterruptibly() on the
channel.close call in PerChannelBookieClient#close for the same effect. Also,
the fact that you call close on the group rather than the individual channels
means PerChannelBookieClient#close gets bypassed completely, which could be a
potential source of bugs, as someone could put cleanup in there that never gets
called.
Who calls the halt() code in the test code? It might be a good idea to move the
releaseExternalResources() call into a new thread to allow halt to be called
from callbacks.
{code}
public void halt() throws InterruptedException {
bookieClient.close();
bookieWatcher.halt();
if (ownChannelFactory) {
new Thread() {
public void run() {
channelFactory.releaseExternalResources();
}
}.start();
}
if (ownZKHandle) {
zk.close();
}
callbackWorker.shutdown();
mainWorkerPool.shutdown();
}
{code}
Also, indentation in general is inconsistent over BK, 4 space in some places, 2
space in others. We should standardize. It may even be a good idea to go
through the whole tree and reindent now, rather than later when such an action
would destroy history (we currently don't have very much history since the
split).
Finally, I think halt() should be called close(). halt() seems to imply that
the bookkeeper service is being stopped, not that you're just closing your
connection to it.
> Issue with Netty in BookKeeper
> ------------------------------
>
> Key: BOOKKEEPER-5
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-5
> Project: Bookkeeper
> Issue Type: Bug
> Reporter: Flavio Junqueira
> Assignee: Flavio Junqueira
> Attachments: BOOKKEEPER-5.patch, BOOKKEEPER-5.patch,
> ZOOKEEPER-998.patch
>
>
> In one my experiments, I found that a BookKeeper object was locked after I
> tried to halt it. By searching the Web, I found that the issue is described
> here:
> http://www.jboss.org/netty/community.html#nabble-td5492010
> I'll upload a patch to fix it. For now, I'm marking it for 3.4.0, but if
> there is any chance we can get it in 3.3.3, it would be nice.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira