[
https://issues.apache.org/jira/browse/BOOKKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13720759#comment-13720759
]
Rakesh R commented on BOOKKEEPER-654:
-------------------------------------
Thanks for the reply:)
bq.but you still need to catch the exception as I commented. a shutdown flag
can't avoid submitting tasks to a shutdown scheduler. that's the point.
In my latest submitted patch, if the executor.isShutdown, its calling the
safeOperationComplete and "return;" back without submitting the request to the
executor. In that way we are returning back to the bookkeeper client, saying
'BkClientClosedException' and not submitting any tasks to the executor. Is that
ok?
OrderedSafeExecutor.java
{code}
public final void operationComplete(final int rc, final T result) {
+ if (executor.isShutdown) {
+ safeOperationComplete(BKException.Code.BkClientClosedException,
+ result);
+ return;
+ }
executor.submitOrdered(orderingKey, new SafeRunnable() {
@Override
{code}
{quote}
my point is a failure speculative task doesn't affect anything. since the
original read request would fail due to bookie client is closed.
{quote}
Its true and agree with you
bq.isClosed checking is also not necessary. the errors already be propagated
from either worker pool callback or bookie client
I've added this check to properly conveying user about the
'BkClientClosedException' returncode.
> 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.2.2, 4.3.0
>
> Attachments: 0001-BOOKKEEPER-654-testcase-to-understand-more.patch,
> 0002-BOOKKEEPER-654.patch, 0003-BOOKKEEPER-654.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