From 6b127916bcbc32e5b93df4de0b8f093421452b03 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 16 Aug 2012 13:34:53 -0700 Subject: [PATCH] Use timeout(1) to timeout gerrit user sync script The gerrit user sync script is showing the same symptoms as the gerrit hook scripts when it comes to hanging on a launchpad connection. Timeout this script as well so that it can be run again instead of perpetually doing nothing. Change-Id: I8d44c6eac76f5820f28eb1723640ce4dac57413b Reviewed-on: https://review.openstack.org/11503 Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins --- modules/launchpad_sync/manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/launchpad_sync/manifests/init.pp b/modules/launchpad_sync/manifests/init.pp index f6544bd286..da72144214 100644 --- a/modules/launchpad_sync/manifests/init.pp +++ b/modules/launchpad_sync/manifests/init.pp @@ -29,7 +29,7 @@ class launchpad_sync( cron { "sync_launchpad_users": user => $user, minute => "*/15", - command => "sleep $((RANDOM\\%60+60)) && python /usr/local/bin/update_gerrit_users.py ${script_user} ${script_key_file} ${site} ${root_team}", + command => "sleep $((RANDOM\\%60+60)) && timeout -k 5m 65m python /usr/local/bin/update_gerrit_users.py ${script_user} ${script_key_file} ${site} ${root_team}", require => File['/usr/local/bin/update_gerrit_users.py'], }