[
https://issues.apache.org/jira/browse/BOOKKEEPER-620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13692682#comment-13692682
]
Sijie Guo commented on BOOKKEEPER-620:
--------------------------------------
{quote}
Do you mean requests which were made after state was set to DISCONNECTED but
before I error out the keys?
{quote}
yes. this is the case I mentioned.
{quote}
This cannot happen, as I only error out the keys which are in the completions
sets when set the state to DISCONNECTED. Anything added afterwards, once the
synchronize block is exited, is fine.
{quote}
I don't understand why you say this couldn't happen. Map#keySet just returned a
view of the keys, which is backed by the underlying map, the changes to
underlying map would affect the set view and vice-versa.
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html#keySet%28%29
> PerChannelBookieClient race during channel disconnect
> -----------------------------------------------------
>
> Key: BOOKKEEPER-620
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-620
> Project: Bookkeeper
> Issue Type: Bug
> Components: bookkeeper-client
> Reporter: Sijie Guo
> Assignee: Ivan Kelly
> Fix For: 4.2.2, 4.3.0
>
> Attachments:
> 0001-BOOKKEEPER-620-PerChannelBookieClient-race-during-ch.patch,
> 0001-BOOKKEEPER-620-PerChannelBookieClient-race-during-ch.patch,
> 0001-BOOKKEEPER-620-PerChannelBookieClient-race-during-ch.patch,
> 0002-BOOKKEEPER-620-PerChannelBookieClient-race-during-ch.patch,
> BOOKKEEPER-620.diff
>
>
> channel & state are not synchronized in PerChannelBookieClient#closeInternal.
> so it might cause state is set to CONNECTED but the netty channel is closed
> by mistake in closeInternal.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira