You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by yo...@apache.org on 2022/11/24 02:53:18 UTC

[bookkeeper] branch master updated: Check client if closed when complete callback. (#3661)

This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 221cba4ed3 Check client if closed when complete callback. (#3661)
221cba4ed3 is described below

commit 221cba4ed32980e6e3109e9b9cca7e380b64ee65
Author: Qiang Zhao <ma...@apache.org>
AuthorDate: Thu Nov 24 10:53:12 2022 +0800

    Check client if closed when complete callback. (#3661)
    
    ### Motivation
    
    Follow the same rules to complete the callback to avoid Bookkeeper client operations being allowed even after its closure.
    
    ### Changes
    
    - Use `bk.getReturnRc(rc)` check the client state.
---
 .../src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java
index 027a3da286..7278af7d42 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java
@@ -206,7 +206,7 @@ class LedgerOpenOp {
                             }
                             if (rc == BKException.Code.UnauthorizedAccessException
                                     || rc == BKException.Code.TimeoutException) {
-                                openComplete(rc, null);
+                                openComplete(bk.getReturnRc(rc), null);
                             } else {
                                 openComplete(bk.getReturnRc(BKException.Code.LedgerRecoveryException), null);
                             }