Allow a file named openbench.exit to signal quiting

This commit is contained in:
Andrew Grant committed 2021-10-06 16:34:31 -04:00
1 parent 44d0c3cb12
commit a28c61c0d0
1 file changed
+9
+9
View File
@@ -861,9 +861,18 @@ if __name__ == '__main__':
while True: while True:
try: try:
# Request a new workload
cleanup_client() cleanup_client()
response = server_request_workload(arguments) response = server_request_workload(arguments)
workload = check_workload_response(arguments, response) workload = check_workload_response(arguments, response)
# Fleet workers exit when there are no workloads
if workload: complete_workload(arguments, workload) if workload: complete_workload(arguments, workload)
elif FLEET_MODE: break elif FLEET_MODE: break
# Check for exit signal via openbench.exit
if os.path.isfile('openbench.exit'):
print('Exited via openbench.exit')
break
except Exception: traceback.print_exc() except Exception: traceback.print_exc()