[
https://issues.apache.org/jira/browse/BOOKKEEPER-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13097985#comment-13097985
]
Ivan Kelly commented on BOOKKEEPER-59:
--------------------------------------
I looked at removing that call to connect in BOOKKEEPER-5 but didn't in the end
because I concluded it was no harm i think. In any case, the synchronization in
#connectIfNeededAndDoOp isn't enough, because the connect is asynchronous. Its
the callback that sets the connected flag. So multiple threads can still end up
kicking off #connect() before one succeeds and sets connected to true.
Actually, we should roll connected and connectionAttemptInProgress into one
flag really. I'll do that now and upload a new patch.
> Race condition in netty code allocates and orphans resources (BK-5 revisited)
> -----------------------------------------------------------------------------
>
> Key: BOOKKEEPER-59
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-59
> Project: Bookkeeper
> Issue Type: Bug
> Reporter: Ivan Kelly
> Assignee: Ivan Kelly
> Fix For: 3.4.0
>
> Attachments: BOOKKEEPER-59.diff
>
>
> We thought BK-5 fixed this, but it still hits if you run for long enough.
> To repro,
> true; while [ $? = 0 ]; do mvn test -Dtest=BookieReadWriteTest; done
> Leave this running for 5-6 hours, and the bug should hit. From looking at the
> code it could be that connect is unsynchronized, so resources could be
> allocated and lost by concurrent executions of connect().
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira