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

Rakesh R commented on BOOKKEEPER-580:
-------------------------------------

Yeah [~hustlmsp]. got it.

Thanks for the patch, just few thoughts:

- Could you please remove following java comments from #asyncCloseInternal() 
api, as now introducing meta.isClosed() check.
{code}
// Close operation is idempotent, so no need to check if we are
// already closed
{code}

- There is an unncessary import in LedgerHandle.java. Anyway we are touching 
the file, it would be good to remove the unnecessary import also:)
      import 
org.apache.bookkeeper.client.BKException.BKNotEnoughBookiesException;

- In the patch, I've seen #isClosed() checks in two places: first before 
submitting, also another one inside the SafeRunnable thread. I agree, there is 
no functional issue. Do we need double check?, I feel we can have only one 
which is inside the SafeRunnable.
{code}
+        synchronized(this) {
+            if (metadata.isClosed()) {
+                cb.closeComplete(BKException.Code.LedgerClosedException, this, 
ctx);
+                return;
+            }
+        }
{code}
                
> improve close logic
> -------------------
>
>                 Key: BOOKKEEPER-580
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-580
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.3.0
>
>         Attachments: BOOKKEEPER-580.diff
>
>
> currently, bookkeeper client still write ledger metadata to metadata storage 
> even the metadata is already closed or undergoing closing. which would cause 
> lots of bad version metadata update encountering unrecoverable errors in 
> ledger handle. e.g. NotEnoughtBookiesException.

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