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

Jean-Noel Rouvignac
17.51.2013 74328205a692a025fbf44a6af9c9f1f456ef34df
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
commit74328205a692a025fbf44a6af9c9f1f456ef34df
tree b9dcba438e644ede18d167d4a9e4245d5999cff0 tree | zip | gz
parent 4f970c081a0cd6ee448aa30f3abdde1c6311638e 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
opends/src/server/org/opends/server/api/DirectoryThread.java 203 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/DbHandler.java 113 ●●●● diff | view | raw | blame | history