Skip to content

Commit

Permalink
Prevent DoS of batch (#3605)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmetzman authored Jan 3, 2024
1 parent c461a96 commit 87c9337
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/clusterfuzz/_internal/bot/tasks/task_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -177,7 +187,7 @@ def execute(self, task_argument, job_type, uworker_env):
'unpack': TrustedTask,
'postprocess': PostprocessTask,
'uworker_main': UworkerMainTask,
'variant': UTaskLocalExecutor,
'variant': UTaskCombined,
}


Expand Down

0 comments on commit 87c9337

Please sign in to comment.