Use timeout(1) to timeout and kill gerrit hooks.

If a gerrit hook blocks none of the other hooks queued behind it run.
Give each hook subprocess 10 minutes to run otherwise timeout and kill
that process.

Change-Id: Ic5e1243e08088dbf0c5bff49e7fc05bcb867819b
Reviewed-on: https://review.openstack.org/11475
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2012-08-16 09:09:00 -07:00 committed by Jenkins
parent 35923f2f21
commit 1160068ce4
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,4 @@
#!/bin/sh
python /usr/local/gerrit/scripts/update_bug.py change-merged "$@"
# Use timeout to kill any process running longer than 10 minutes.
timeout -k 2m 10m python /usr/local/gerrit/scripts/update_bug.py change-merged "$@"

View File

@ -1,5 +1,6 @@
#!/bin/sh
python /usr/local/gerrit/scripts/update_blueprint.py patchset-created "$@"
python /usr/local/gerrit/scripts/update_bug.py patchset-created "$@"
python /usr/local/gerrit/scripts/notify_doc_impact.py patchset-created "$@"
# Use timeout to kill any process running longer than 10 minutes.
timeout -k 2m 10m python /usr/local/gerrit/scripts/update_blueprint.py patchset-created "$@"
timeout -k 2m 10m python /usr/local/gerrit/scripts/update_bug.py patchset-created "$@"
timeout -k 2m 10m python /usr/local/gerrit/scripts/notify_doc_impact.py patchset-created "$@"