From ecd9d69eef8728b2fdc6bc176de414ea46d44a05 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Fri, 1 Nov 2024 17:15:33 -0500 Subject: [PATCH] don't kill submit because of bad actors --- iceprod/server/grid.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/iceprod/server/grid.py b/iceprod/server/grid.py index a0107a66..ef8dec42 100644 --- a/iceprod/server/grid.py +++ b/iceprod/server/grid.py @@ -140,9 +140,16 @@ async def get_tasks_to_queue(self, num: int) -> list[Task]: tasks = [] for f in asyncio.as_completed(futures): - task = await f - # add default resource requirements - task.requirements = self._get_resources(task) + try: + task = await f + except Exception: # already logged in function + continue + try: + # add default resource requirements + task.requirements = self._get_resources(task) + except Exception: + logger.warning('cannot get task resources for %s.%s', task.dataset.dataset_id, task.task_id, exc_info=True) + continue tasks.append(task) return tasks @@ -176,7 +183,7 @@ async def _convert_to_task(self, task): add_default_options(config['options']) except Exception: - logger.warning('Error converting task dict to task: %s.%s', task['dataset_id'], task['task_id']) + logger.warning('Error converting task dict to task: %s.%s', task['dataset_id'], task['task_id'], exc_info=True) raise return t