Skip to content

Commit 0a625ce

Browse files
committed
Fix to also rollback on RuntimeException
1 parent d9caaae commit 0a625ce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/org/opensolaris/opengrok/index/IndexDatabase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,10 @@ public void update() throws IOException {
473473
} catch (IOException e) {
474474
finishingException = e;
475475
}
476+
} catch (RuntimeException ex) {
477+
LOGGER.log(Level.SEVERE,
478+
"Failed with unexpected RuntimeException", ex);
479+
throw ex;
476480
} finally {
477481
Ctags finishingCtags = ctags;
478482
ctags = null;
@@ -1372,7 +1376,7 @@ private void finishWriting() throws IOException {
13721376
// rollback() regardless of success.
13731377
hasPendingCommit = false;
13741378
writer.commit();
1375-
} catch (IOException e) {
1379+
} catch (RuntimeException|IOException e) {
13761380
if (hasPendingCommit) writer.rollback();
13771381
LOGGER.log(Level.WARNING,
13781382
"An error occured while finishing writer and completer", e);

0 commit comments

Comments
 (0)