mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
02.09.2007 4864cfb0b10b6a14610936b7409558e54bdd41bd
Fix a problem in the DbHandler.run() method that appears to make it possible to
create a tight infinite loop if the method is still running after the database
has been closed, repeatedly catching and logging exceptions. This change adds
a break statement after logging the message so that it will exit from the loop.

The exception being caught was:

com.sleepycat.je.DatabaseException: (JE 3.2.29) Attempt to use non-open Environment object().
at com.sleepycat.je.Environment.checkHandleIsValid(Environment.java:1147)
at com.sleepycat.je.Environment.beginTransactionInternal(Environment.java:731)
at com.sleepycat.je.Environment.beginTransaction(Environment.java:720)
at org.opends.server.replication.server.ReplicationDbEnv.beginTransaction(ReplicationDbEnv.java:381)
at org.opends.server.replication.server.ReplicationDB$ReplServerDBCursor.<init>(ReplicationDB.java:363)
at org.opends.server.replication.server.ReplicationDB$ReplServerDBCursor.<init>(ReplicationDB.java:314)
at org.opends.server.replication.server.ReplicationDB.openDeleteCursor(ReplicationDB.java:205)
at org.opends.server.replication.server.DbHandler.trim(DbHandler.java:384)
at org.opends.server.replication.server.DbHandler.run(DbHandler.java:335)
at java.lang.Thread.run(Thread.java:619)
1 files modified
1 ■■■■ changed files
opends/src/server/org/opends/server/replication/server/DbHandler.java 1 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/DbHandler.java
@@ -348,6 +348,7 @@
        mb.append(ERR_EXCEPTION_CHANGELOG_TRIM_FLUSH.get());
        mb.append(stackTraceToSingleLineString(end));
        logError(mb.toMessage());
        break;
      }
    }
    // call flush a last time before exiting to make sure that