eolivelli opened a new pull request #2384:
URL: https://github.com/apache/bookkeeper/pull/2384
Descriptions of the changes in this PR:
### Motivation
Every time a problem with ZK arises you don't see it in the exception chain
of the BKException (in this case ZKException) and you end up with errors like:
```
org.apache.bookkeeper.client.BKException$ZKException: Error while using
ZooKeeper
at
org.apache.bookkeeper.client.SyncCallbackUtils.finish(SyncCallbackUtils.java:83)
at
org.apache.bookkeeper.client.SyncCallbackUtils$SyncAddCallback.addComplete(SyncCallbackUtils.java:251)
at
org.apache.bookkeeper.client.AsyncCallback$AddCallback.addCompleteWithLatency(AsyncCallback.java:91)
at
org.apache.bookkeeper.client.PendingAddOp.submitCallback(PendingAddOp.java:430)
at
org.apache.bookkeeper.client.LedgerHandle.errorOutPendingAdds(LedgerHandle.java:1784)
at
org.apache.bookkeeper.client.LedgerHandle$5.safeRun(LedgerHandle.java:574)
```
### Changes
Add a "cause" to every ZKException.
### Notes
There are very few places that cannot be fixed because they are still using
the old callback based mechanism without CompletableFuture. Those points are
not changed in order to make the patch simple but still useful.
> ---
> In order to uphold a high standard for quality for code contributions,
Apache BookKeeper runs various precommit
> checks for pull requests. A pull request can only be merged when it passes
precommit checks.
>
> ---
> Be sure to do all of the following to help us incorporate your contribution
> quickly and easily:
>
> If this PR is a BookKeeper Proposal (BP):
>
> - [ ] Make sure the PR title is formatted like:
> `<BP-#>: Description of bookkeeper proposal`
> `e.g. BP-1: 64 bits ledger is support`
> - [ ] Attach the master issue link in the description of this PR.
> - [ ] Attach the google doc link if the BP is written in Google Doc.
>
> Otherwise:
>
> - [ ] Make sure the PR title is formatted like:
> `<Issue #>: Description of pull request`
> `e.g. Issue 123: Description ...`
> - [ ] Make sure tests pass via `mvn clean apache-rat:check install
spotbugs:check`.
> - [ ] Replace `<Issue #>` in the title with the actual Issue number.
>
> ---
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]