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

Jean-Noel Rouvignac
16.22.2014 c681dd006793929eb80578b7c8b811fd752e0622
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, May 16, 2014 10:22 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, May 16, 2014 10:22 +0200
commitc681dd006793929eb80578b7c8b811fd752e0622
tree a80e96c6332ee23746e473c3e1c831a4596576bb tree | zip | gz
parent 4753376687d15ed72d20e7f74dbdfbc1e2e962ac view | diff
Fixing JEChangeNumberIndexDBTest random tests.
JE was throwing exception when the thread accessing it had been interrupted which happens frequently on single core machines.
The solution is to replace the use of Thread.sleep(long) + Thread.interrupt() with Object.wait(long) + Object.notify() on thread shutdown.



JEChangelogDB.java:
Replaces the use of Thread.sleep(long) + Thread.interrupt() with Object.wait(long) + Object.notify() on thread shutdown.
Created method jeFriendlySleep(long) to emulate Thread.sleep(long).

ReplicationServer.java:
Code cleanup.
Changed shutdown field from boolean to AtomicBoolean.
Added final keyword to fields.
Reduced visibility of waitConnections() from public to default.
In shutdown(), used StaticUtils.close().
2 files modified
159 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java 106 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/JEChangelogDB.java 53 ●●●● diff | view | raw | blame | history