This is an automated email from the ASF dual-hosted git repository.
sijie 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 07ec9d8 Enhance exception logging.
07ec9d8 is described below
commit 07ec9d897255d07f772a084561fb0e17e0f0bc7a
Author: cguttapalem <[email protected]>
AuthorDate: Wed Jan 24 21:57:19 2018 -0800
Enhance exception logging.
Descriptions of the changes in this PR:
- log exception in the case of exception in Bookie.shutdown
and BookKeeperClusterTestCase.tearDown.
Author: cguttapalem <[email protected]>
Reviewers: Sijie Guo <[email protected]>
This closes #1050 from reddycharan/logexception
---
.../java/org/apache/bookkeeper/bookie/Bookie.java | 3 +++
.../bookkeeper/test/BookKeeperClusterTestCase.java | 25 +++++++++++++++++++---
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
index 8eafa9f..da0525a 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
@@ -1035,6 +1035,9 @@ public class Bookie extends BookieCriticalThread {
}
} catch (InterruptedException ie) {
LOG.error("Interrupted during shutting down bookie : ", ie);
+ } catch (Exception e) {
+ LOG.error("Got Exception while trying to shutdown Bookie", e);
+ throw e;
} finally {
// setting running to false here, so watch thread
// in bookie server know it only after bookie shut down
diff --git
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
index 4f6788b..526a4c7 100644
---
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
+++
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
@@ -126,13 +126,32 @@ public abstract class BookKeeperClusterTestCase {
public void tearDown() throws Exception {
Stopwatch sw = Stopwatch.createStarted();
LOG.info("TearDown");
+ Exception tearDownException = null;
// stop bookkeeper service
- stopBKCluster();
+ try {
+ stopBKCluster();
+ } catch (Exception e) {
+ LOG.error("Got Exception while trying to stop BKCluster", e);
+ tearDownException = e;
+ }
// stop zookeeper service
- stopZKCluster();
+ try {
+ stopZKCluster();
+ } catch (Exception e) {
+ LOG.error("Got Exception while trying to stop ZKCluster", e);
+ tearDownException = e;
+ }
// cleanup temp dirs
- cleanupTempDirs();
+ try {
+ cleanupTempDirs();
+ } catch (Exception e) {
+ LOG.error("Got Exception while trying to cleanupTempDirs", e);
+ tearDownException = e;
+ }
LOG.info("Tearing down test {} in {} ms.", runtime.getMethodName(),
sw.elapsed(TimeUnit.MILLISECONDS));
+ if (tearDownException != null) {
+ throw tearDownException;
+ }
}
protected File createTempDir(String prefix, String suffix) throws
IOException {
--
To stop receiving notification emails like this one, please contact
[email protected].