exception ignored, leads to bug
Jens.Wulf at sew-eurodrive.de
Jens.Wulf at sew-eurodrive.de
Wed Mar 4 04:42:19 CST 2009
version: Mercurial Distributed SCM (version 1.1.2+tortoisehg)
In order to test the system when concurrently writing to a 'central' repo on a windows share I used several instances of a tiny python program (maybe my third python program?):
#########################################################################
# first argument: name of central repo
# second argument: name of clone
# further arguments: file names
import time, os, sys, random
def CreateFile(path, filename):
os.system("echo " + str(random.random()) + " > " + path + "\\" + path+"_"+filename)
return
def CommitAndPush(path):
os.system("hg addremove --cwd " + path + " -q")
os.system("hg ci --cwd " + path + " -m \"" + path + " " + str(random.random()) + "\" -q")
os.system("hg push --cwd " + path + " -f -q")
os.system("hg verify --cwd " + path + " -q")
return
# create clone
os.system("hg clone " + sys.argv[1] + " " + sys.argv[2])
# modify clone, push back
while 1 > 0:
for fn in sys.argv[3:]:
CreateFile(sys.argv[2], fn)
CommitAndPush(sys.argv[2])
os.system("hg verify --cwd " + sys.argv[1] + " -q")
#########################################################################
Every instance of these processes clones a repo, commits to the clone, pushes back and verifies both the clone and the original repo, so there are several processes pushing to the central repo.
Sometimes an error happens to the clone (which is never accessed by several processes at once):
Exception exceptions.WindowsError: (32, 'Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird', 'O:\\GRUPPEN\\GTI\\Austausch\\jww\\stresstest\\C\\.hg\\tmp5pndai') in <bound method lock.__del__ of <mercurial.lock.lock object at 0x00B4A490>> ignored
The result is that commit history in the clone is not linear but has a single-commit-branch caused by the above error.
Best regards,
Jens
More information about the Mercurial
mailing list