mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-06 18:35:18 +00:00
retry posting killer tasks if queue full
This commit is contained in:
parent
d1dd93269d
commit
34e882afa6
@ -98,8 +98,18 @@ Gun: {gun.__class__.__name__}
|
||||
self.log.info(
|
||||
"Feeded all data. Publishing %d killer tasks" % (
|
||||
workers_count))
|
||||
retry_delay = 1
|
||||
for _ in range(5):
|
||||
try:
|
||||
[self.task_queue.put(None, timeout=1) for _ in xrange(
|
||||
0, workers_count)]
|
||||
break
|
||||
except Full:
|
||||
self.log.debug(
|
||||
"Couldn't post killer tasks"
|
||||
" because queue is full. Retrying in %ss", retry_delay)
|
||||
time.sleep(retry_delay)
|
||||
retry_delay *= 2
|
||||
|
||||
try:
|
||||
self.log.info("Waiting for workers")
|
||||
|
Loading…
Reference in New Issue
Block a user