Skip to content

Commit b329a3a

Browse files
committed
HADOOP-4267. Occasional exceptions during shutting down HSQLDB is logged but not rethrown. Contributed by Enis Soztutar.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@702752 13f79535-47bb-0310-9956-ffa450edef68
1 parent 40e1adf commit b329a3a

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

.eclipse.templates/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<classpathentry kind="lib" path="lib/commons-logging-1.0.4.jar"/>
2020
<classpathentry kind="lib" path="lib/commons-logging-api-1.0.4.jar"/>
2121
<classpathentry kind="lib" path="lib/commons-net-1.4.1.jar"/>
22-
<classpathentry kind="lib" path="lib/hsqldb.jar"/>
22+
<classpathentry kind="lib" path="lib/hsqldb-1.8.0.10.jar"/>
2323
<classpathentry kind="lib" path="lib/jets3t-0.6.1.jar"/>
2424
<classpathentry kind="lib" path="lib/jetty-5.1.4.jar"/>
2525
<classpathentry kind="lib" path="lib/jetty-ext/commons-el.jar"/>

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@ Release 0.19.0 - Unreleased
867867
HADOOP-4256. Removes Completed and Failed Job tables from
868868
jobqueue_details.jsp. (Sreekanth Ramakrishnan via ddas)
869869

870+
HADOOP-4267. Occasional exceptions during shutting down HSQLDB is logged
871+
but not rethrown. (enis)
872+
870873
Release 0.18.2 - Unreleased
871874

872875
BUG FIXES
File renamed without changes.
File renamed without changes.

src/examples/org/apache/hadoop/examples/DBCountPageView.java

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import org.apache.hadoop.mapred.lib.db.DBInputFormat;
5050
import org.apache.hadoop.mapred.lib.db.DBOutputFormat;
5151
import org.apache.hadoop.mapred.lib.db.DBWritable;
52+
import org.apache.hadoop.util.StringUtils;
5253
import org.apache.hadoop.util.Tool;
5354
import org.apache.hadoop.util.ToolRunner;
5455
import org.hsqldb.Server;
@@ -99,13 +100,22 @@ private void createConnection(String driverClassName
99100
connection.setAutoCommit(false);
100101
}
101102

102-
private void shutdown() throws SQLException {
103-
connection.commit();
104-
connection.close();
105-
106-
if(server != null) {
107-
server.stop();
108-
server.shutdown();
103+
private void shutdown() {
104+
try {
105+
connection.commit();
106+
connection.close();
107+
}catch (Throwable ex) {
108+
LOG.warn("Exception occurred while closing connection :"
109+
+ StringUtils.stringifyException(ex));
110+
} finally {
111+
try {
112+
if(server != null) {
113+
server.shutdown();
114+
}
115+
}catch (Throwable ex) {
116+
LOG.warn("Exception occurred while shutting down HSQLDB :"
117+
+ StringUtils.stringifyException(ex));
118+
}
109119
}
110120
}
111121

0 commit comments

Comments
 (0)