diff --git a/src/clusterfuzz/_internal/bot/tasks/task_types.py b/src/clusterfuzz/_internal/bot/tasks/task_types.py index 6958fb189a..429973ede7 100644 --- a/src/clusterfuzz/_internal/bot/tasks/task_types.py +++ b/src/clusterfuzz/_internal/bot/tasks/task_types.py @@ -120,6 +120,16 @@ def preprocess(self, task_argument, job_type, uworker_env): return download_url +class UTaskCombined(BaseUTask): + """Special kind of UTask where tasks are created as utasks and treated as + tasks within a batch job. Tasks received on the queue will still execute + locally. This should ease the transition to UTask and prevent batch from being + DoSed.""" + def execute(self, task_argument, job_type, uworker_env): + self.execute_locally(task_argument, job_type, uworker_env) + + + def is_remotely_executing_utasks(): return (environment.is_production() and environment.get_value('REMOTE_UTASK_EXECUTION') and @@ -177,7 +187,7 @@ def execute(self, task_argument, job_type, uworker_env): 'unpack': TrustedTask, 'postprocess': PostprocessTask, 'uworker_main': UworkerMainTask, - 'variant': UTaskLocalExecutor, + 'variant': UTaskCombined, }