Commit c9250096 authored by Daniele Venzano's avatar Daniele Venzano

Fix the idle script, exception when shrinking the running set

parent bb7e46f0
......@@ -131,11 +131,11 @@ def keep_some_running(zapps, exec_name, api):
elif state == "shrink":
while usage > USAGE_WATERMARK:
print("Platform usage is {} (target {}), terminating some executions".format(queue_length, usage, USAGE_WATERMARK - USAGE_HYSTERESIS))
print("Platform usage is {} (target {}), queue length is {}, terminating some executions".format(usage, USAGE_WATERMARK - USAGE_HYSTERESIS, queue_length))
if 0 < len(currently_running) <= BATCH_SIZE_TO_KILL:
to_kill = currently_running
to_kill = currently_running.sort()[-5:]
to_kill = sorted(currently_running)[-5:]
print("Terminating {}".format(to_kill))
for exec_id in to_kill:
terminate_zapp(exec_id, api)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment