summaryrefslogtreecommitdiffstats
path: root/ldap/admin/src/create_instance.c
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2006-12-02 00:14:25 +0000
committerRich Megginson <rmeggins@redhat.com>2006-12-02 00:14:25 +0000
commit0e6cd94b2023ef452a734cc4efba7a83d9ecc6c5 (patch)
tree3ec60ee6543140d50128175b41b6b570fd7e9dac /ldap/admin/src/create_instance.c
parenta779d5b995a9442cbb1758b17743038d59deec46 (diff)
downloadds-0e6cd94b2023ef452a734cc4efba7a83d9ecc6c5.tar.gz
ds-0e6cd94b2023ef452a734cc4efba7a83d9ecc6c5.tar.xz
ds-0e6cd94b2023ef452a734cc4efba7a83d9ecc6c5.zip
Resolves: bug 218076
Bug Description: Server autoconf build crashes when stopped/started very quickly Reviewed by: nhosoi (Thanks!) Fix Description: The problem was that 3 of the database threads were being started and stopped before the 4th had a chance to start. So the thread count would start at 3 and drop to 0, and the dblayer_pre_close code would think everything was fine. The 4th thread is the checkpoint thread which was doing a db_checkpoint operation before incrementing the thread count. For some reason, on x86_64 with the system provided libdb-4.2, the checkpoint operation was taking longer than it usually does with our locally built libdb-4.2, so this allowed the other 3 threads to stop and start before the checkpoint thread had a chance to increment the thread count. The solution is to make sure the incrementing of the thread count occurs as early as possible in the thread function, before any executable code that might take any time. This should ensure that all of the threads start up and increment the thread count before the shutdown occurs. The second part of the solution is that, according to wtc, the NSPR maintainer, the PR_Atomic functions should not be used as a semaphore like this. So, the code was rewritten to use locks and condition variables. The code is not performance critical, so adding locking should not have any impact on performance. In addition, the new code is much cleaner, more correct, and more obvious about what it's doing. Platforms tested: RHEL4 x86_64 Flag Day: no Doc impact: no
Diffstat (limited to 'ldap/admin/src/create_instance.c')
0 files changed, 0 insertions, 0 deletions