-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[managed-ledger] create bookkeeper client during ManagedLedger shutdown #4573
Comments
@rdhabalia could you please take a look at this? It seems it's caused by #3933? public void shutdown() throws InterruptedException, ManagedLedgerException {
......
......
if (zookeeper != null) {
zookeeper.close();
}
if (isBookkeeperManaged) {
try {
BookKeeper bkFactory = bookkeeperFactory.get(); // this create a new bookkeeper using closed zk.
if (bkFactory != null) {
bkFactory.close();
}
} catch (BKException e) {
throw new ManagedLedgerException(e);
}
} |
@yjshen it seems issue happens when application tries to create managed-ledger-factory using self-managed-bk-constructor which constructor is not used by broker. |
sijie
pushed a commit
that referenced
this issue
Jun 25, 2019
### Motivation User can create tools on bookkeeper using ManagedLedger factory which provides [constructor](https://github.com/apache/pulsar/blob/master/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java#L121) to create ml-factory using self-managed bookkeeper (it's not used by broker). So, in case of self-managed bk-client, ML-Factory couldn't shutdown it gracefully and we see issue: #4573 ### Modification - ML-Factory creates `DefaultBkFactory` to create self-managed bk-client and shutdowns same bk-client while closing the resource.
It is fixed by #4580 |
codelipenghui
pushed a commit
that referenced
this issue
Jun 26, 2019
### Motivation User can create tools on bookkeeper using ManagedLedger factory which provides [constructor](https://github.com/apache/pulsar/blob/master/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java#L121) to create ml-factory using self-managed bookkeeper (it's not used by broker). So, in case of self-managed bk-client, ML-Factory couldn't shutdown it gracefully and we see issue: #4573 ### Modification - ML-Factory creates `DefaultBkFactory` to create self-managed bk-client and shutdowns same bk-client while closing the resource.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
During
ManagedLedgerFactoryImpl.shutdown()
, the zookeeper client is closed first and whenisBookkeeperManager
, it will get a bookkeeper frombookkeeperFactory.get()
which result in creating new BookKeeper client using closed zk client, which caused this bug.The text was updated successfully, but these errors were encountered: