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

Jean-Noel Rouvignac
05.50.2013 caef6ed626aa6ab49fa569a61307d0febdc798b6
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Thursday, December 5, 2013 10:50 +0100
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Thursday, December 5, 2013 10:50 +0100
commitcaef6ed626aa6ab49fa569a61307d0febdc798b6
tree 8afc4ade9c6d27b77f2d2d0b3968535df439b668 tree | zip | gz
parent b38c19075fa9a4946e6955ce1b2abf32af5440c4 view | diff
Fixed a readWriteLock deadlock happening on calling ChangelogDB.removeDB() which then calls ReplicationDB.shutdown().
Code is blocked acquiring a writeLock on the dbCloseLock, but a readLock is never unlocked.
Debugging showed that the ChangeNumberIndexDB is holding a cursor on a ReplicationDB, said cursor holds the readLock.
The solution is to not try to call ReplicationDB.shutdown() in ReplicationServerDomain.shutdownDomain() because it will be closed by JEChangelogDB.shutdownDB().


ReplicationServerDomain.java:
Removed the call to ReplicationDB.shutdownDomain(DN).

ReplicationDomainDB.java, JEChangelogDB.java:
Removed shutdownDomain(DN) which was never used outside of a complete shutdown of the ReplicationServer.
Inlined innerShutdownDomain().

JEReplicaDBCursor.java:
In next(), extracted a local variable to protect against a concurrent update to the cursor field.
4 files modified
52 ■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java 3 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java 8 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/JEChangelogDB.java 36 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/JEReplicaDBCursor.java 5 ●●●●● diff | view | raw | blame | history