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

Jean-Noel Rouvignac
17.51.2013 0b8de8e6dbc4760fa587d12dd868c7c9f577b261
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, September 17, 2013 09:51 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, September 17, 2013 09:51 +0200
commit0b8de8e6dbc4760fa587d12dd868c7c9f577b261
tree a1d7d06d59bf63182526abc1ed5c56d84d08f6d9 tree | zip | gz
parent 0867cca5b14dc1291ad9c8be04a5617b4d1b8d5f view | diff
OPENDJ-1130 (CR-2323) Connect Error when stopping all the servers from a replication topology at the same time

Properly marked the state of the thread + checked it from the deeper DbHandler.trim() to ensure the thread stops as fast as possible. DB reentrant locsk then ensure the threads properly wait on each other before shutdown.

DirectoryThread.java:
Added ThreadState enum + a threadState AtomicReference instance field.
Added isShutdownInitiated(), initiateShutdown(), startWork(), stopWork(), setThreadStateIfNotShuttingDown(), getThreadState().
Converted comments to javadocs.
In uncaughtException(), do not log ThreadDeath error (coming from Ludo, suggested as part of OPENDJ-1061).

DbHandler.java:
Removed shutdown and done instance fields (replaced by the DirectoryThread.threadState). The done instance field had an ill defined purpose and its usefulness was questionable.
In shutdown(), used DirectoryThread thread state management methods + removed dead code.
In run() and trim(), used DirectoryThread thread state management methods.
2 files modified
316 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/api/DirectoryThread.java 203 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/DbHandler.java 113 ●●●● diff | view | raw | blame | history