Add a sleep() prior to calling tasks to ensure postop writes are done

We were seeing a rare deadlock of DS when creating the memberOf task because
one thread was adding memberOf in a postop while another was trying to
create an index and this was causing a PRLock deadlock.
This commit is contained in:
Rob Crittenden 2009-10-12 13:54:08 -04:00
parent cc23838db2
commit 5ad91a0781

View File

@ -265,6 +265,9 @@ class LDAPUpdate:
def create_index_task(self, attribute):
"""Create a task to update an index for an attribute"""
# Sleep a bit to ensure previous operations are complete
time.sleep(5)
r = random.SystemRandom()
# Refresh the time to make uniqueness more probable. Add on some