2

I am facing a very weird problem: I am using mailer.py as post-commit hooks to send codes diff to developers. But then I find all codes check-in to this repository is very slow, even 1 file check in will cost around 2 minutes. Disable the post-commit will make codes check-in much faster. I check the apache log and subversion log but find nothing valuable. Can anyone give some idea about this problem?

Environment: Redhat EL 5.4 + CollabNet SubversionEdge 2.0

Thanks,

Jeffrey

2
  • 2
    My hypothesis is that your post-commit hook script takes around 2 minutes to run. Sep 1, 2011 at 10:37
  • Yes, it takes a long time to run but I was supposing post-commit is run in async way, but it's not. Anyway, I figured out a way to run the tasks as background task now.
    – asticx
    Sep 1, 2011 at 15:42

2 Answers 2

2

Perhaps you can spawn off the diff and mailer task as separate processes from the post-commit script. That way the checkin process can finish and return while the lengthy operations continue as a background task.

1
  • I was supposing that the post-commit is designed to run as background task but after some searching I get one comment: When running hooks, svn calls apr_proc_wait, apr_proc_wait is designed to wait until all child processes exit before returning. So I have to append ">> /dev/null 2>&1" as well as "&", so that the diff check and mailer is detached from the post-commit process. It looks like everything is working as I expected.
    – asticx
    Sep 1, 2011 at 15:27
1

I was just facing the same problem. The mailer.py used to work just fine, with almost immediate commits, but after deploying a new authentication schema that incorporated a faulty automount entry, it started to slow down to minutes.
It all boiled down to the mailer.py testing for some libraries, as running it through strace revealed.

As part of the post-commit hook, that normally would run the mailer.py, I inserted a strace just like:

# EXAMPLE OF DOING STRACE TO DEBUG/TROUBLESHOOT THIS:
/usr/bin/strace /usr/share/doc/subversion-1.6.11/tools/hook-scripts/mailer/mailer.py commit "$REPOS" "$REV" > /tmp/zzSTRACE-MAILER 2>&1
# (The original line is)
# /usr/share/doc/subversion-1.6.11/tools/hook-scripts/mailer/mailer.py commit "$REPOS" "$REV"


This showed the script looking for the os.py and os.pyc files under several locations (in my CentOS 6 system they are under /usr/lib64/python2.6).
One of the searched locations is /users which was in the automount map pointing to an unresponsive server. It thus hung until timing it out - then the script continued & the commit operation finished OK - only with that enormous delay.

Repairing the automount entry / fixing that server immediately solved the issue.
Hopefully this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.