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

Jean-Noel Rouvignac
05.07.2013 6f6a31acb823540085555a12aa934720742b9edf
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Thursday, December 5, 2013 11:07 +0100
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Thursday, December 5, 2013 11:07 +0100
commit6f6a31acb823540085555a12aa934720742b9edf
tree 7b932fc6539cf1fe7f3f5d56fffd00cbb35334e9 tree | zip | gz
parent 29a9e43886d93487990a3b8f9f5f46e5acdce034 view | diff
#2 Fixed a readWriteLock deadlock happening in tests 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.
Despite the ChangeNumberIndexer thread being asked to initiateShutdown(), the thread is waiting indefinitely for new changes which will never come.

DirectoryThread.java:
In initiateShutdown(), call interrupt() to ensure the thread will be interrupted if it calls Object.wait() before checking whether it needs to shutdown, or if it is already waiting.
1 files modified
1 ■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/api/DirectoryThread.java 1 ●●●● diff | view | raw | blame | history