Skip to content

Commit d792998

Browse files
authored
capture error for mapping (#5325)
fix b/524480139 This PR update the batch service to handle when the config mapping doesn't match. The problem is that this raises a exception which avoids to ack the message from pubsub, keeping the problematic task in the queue forever. For this case of mismatching, we should log and remove the task from the queue to avoid no scheduling legit tasks. Signed-off-by: Javan Lacerda <javanlacerda@google.com>
1 parent f69c2e6 commit d792998

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/clusterfuzz/_internal/batch/service.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,15 @@ def _get_specs_from_config(
356356
if (task.command, task.job_type) in specs:
357357
# Don't repeat work for no reason.
358358
continue
359-
config_name, disk_size_gb, base_os_version = config_map[(task.command,
360-
task.job_type)]
359+
try:
360+
config_name, disk_size_gb, base_os_version = config_map[(task.command,
361+
task.job_type)]
362+
except Exception:
363+
logs.error(
364+
'Error on mapping the job',
365+
command=task.command,
366+
job_type=task.job_type)
367+
continue
361368

362369
instance_spec = batch_config.get('mapping').get(config_name)
363370
if instance_spec is None:

0 commit comments

Comments
 (0)