Revert "Rate limit testenv creation"

This reverts commit 0030f6c664.

Test env requests are queuing up and nothing is getting a env in a timely
mannor. As I think we are still trying to create envs for jobs that have
timed out. Revert this to our behaviour befor last week while we investigate
the problem.

Change-Id: I79353941d838628e492b46acce6dde8ef2ec3aff
This commit is contained in:
Derek Higgins 2016-12-09 12:36:37 +00:00
parent 837133e5e1
commit a04150eb99
2 changed files with 3 additions and 14 deletions

View File

@ -12,10 +12,6 @@ vcsrepo {"/opt/stack/tripleo-ci":
ensure => latest,
}
package {"python-posix_ipc":
ensure => "present",
}
cron {"refresh-server":
command => "timeout 20m puppet apply /opt/stack/tripleo-ci/scripts/te-broker/te-broker.pp",
minute => "*/30"

View File

@ -31,7 +31,6 @@ import time
import uuid
import gear
import posix_ipc
# 100Mb log files
maxBytes=1024*1024*100
@ -126,15 +125,9 @@ class TEWorkerThread(threading.Thread):
try:
with tempfile.NamedTemporaryFile('r') as fp:
os.environ["TE_DATAFILE"] = fp.name
# Limit the number of concurrent environment creations to 5.
# This will hopefully reduce the number of testenv creations
# that fail or timeout due to an overloaded controller.
with posix_ipc.Semaphore('testenv-worker',
flags=posix_ipc.O_CREAT,
initial_value=5):
logger.info(
subprocess.check_output([self.scriptfiles[0], self.num, arguments.get("envsize","2"), arguments.get("ucinstance","")], stderr=subprocess.STDOUT))
clientdata = fp.read()
logger.info(
subprocess.check_output([self.scriptfiles[0], self.num, arguments.get("envsize","2"), arguments.get("ucinstance","")], stderr=subprocess.STDOUT))
clientdata = fp.read()
except subprocess.CalledProcessError as e:
logger.error(e.output)
clientdata = "Couldn't retrieve env"