[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13753330#comment-13753330
 ] 

Sijie Guo commented on BOOKKEEPER-654:
--------------------------------------

{quote}
I think it's a good thing to notify the user when they've done something 
stupid. Currently the code can just hang in this situation, so to a user it is 
unclear whether the bug is in their code or our code.
{quote}


if we want to avoid something weird, we should also catch all exceptions thrown 
when submitting tasks to a closed scheduler. otherwise, any uncaught runtime 
exception would fail the process, except the application registered uncaught 
exception handler. I don't see a clean way to do that, even you have a mapping 
to maintain all the callback things.

so here is the thing: 

if the application uses async methods, does it matter if it doesn't receive a 
specific callback when it closed the bookkeeper handle? since the async way 
would not block anything.

if the application uses sync methods, a clean change is to change SyncCounter 
to use time wait, when timeout, it checked if the client is closed, if it is 
closed, fail the sync call, if it is not closed, then wait.

since this is not a critical part, I would prefer a simple way to handle it 
rather than involving too much code changes.

Besides, I would like to see how zookeeper handle this kind of situation before 
we moved on, as we are kind of relying on zookeeper callbacks. [~fpj] do you 
know how zookeeper handles the async & sync methods when zookeeper client is 
closed?






                
> Bookkeeper client operations are allowed even after its closure, bk#close()
> ---------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-654
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-654
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.2.0
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 4.3.0
>
>         Attachments: 
> 0001-BOOKKEEPER-654-Bookkeeper-client-operations-are-allo.patch, 
> 0001-BOOKKEEPER-654-testcase-to-understand-more.patch, 
> 0002-BOOKKEEPER-654.patch, 0003-BOOKKEEPER-654.patch, 
> 0004-BOOKKEEPER-654.patch, 0005-BOOKKEEPER-654.patch, 
> 0006-BOOKKEEPER-654-handled-inprogress-and-newrequests.patch
>
>
> User can perform below operations with the closed bookkeeper client, which 
> was instantiated with external zkclient.
> - open a closed ledger 
> - create a new ledger 
> Also, ledgerhandle operations like fencing/add/write are infinitely hanging.

--
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

Reply via email to