From 613e542b46c2497ddccf7bf8bcb2569ba75466cb Mon Sep 17 00:00:00 2001 From: Hunt Xu Date: Fri, 20 Jul 2018 18:28:50 +0800 Subject: [PATCH] Runtime: less strict for resource limiting When resource limiting fails, just log a message instead of failing the execution. Change-Id: I1942620ecbe35508032e11dafc4784f6ff2300e1 Story: 2003053 Task: 23090 --- runtimes/python2/server.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/runtimes/python2/server.py b/runtimes/python2/server.py index acef5352..e2558bcf 100644 --- a/runtimes/python2/server.py +++ b/runtimes/python2/server.py @@ -98,16 +98,15 @@ def _invoke_function(execution_id, zip_file_dir, module_name, method, arg, 'pid': pid } ) - if not root_resp.ok: - return_dict['result'] = root_resp.content - return_dict['success'] = False - sys.exit(0) - sys.path.insert(0, zip_file_dir) sys.stdout = open("%s.out" % execution_id, "w", 0) + if not root_resp.ok: + print('WARN: Resource limiting failed, run in unlimit mode.') + print('Start execution: %s' % execution_id) + sys.path.insert(0, zip_file_dir) try: module = importlib.import_module(module_name) func = getattr(module, method)