Skip to content

Commit b8b457f

Browse files
Create utasks properly on tworkers (#4421)
1 parent ccb5ef6 commit b8b457f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/clusterfuzz/_internal/bot/tasks/commands.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,15 @@ def get_command_object(task_name):
196196
if not environment.is_tworker():
197197
return task
198198

199+
if task_name in {'postprocess', 'uworker_main'}:
200+
return task
201+
199202
if isinstance(task, task_types.TrustedTask):
200203
# We don't need to execute this remotely.
201204
return task
202205

203206
# Force remote execution.
204-
return task_types.UTask(task_name)
207+
return task_types.UTask(_COMMAND_MODULE_MAP[task_name])
205208

206209

207210
def run_command(task_name, task_argument, job_name, uworker_env):

src/clusterfuzz/_internal/bot/tasks/task_types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ def execute(self, task_argument, job_type, uworker_env):
128128
"""Executes a utask."""
129129
logs.info('Executing utask.')
130130
command = task_utils.get_command_from_module(self.module.__name__)
131-
if not is_remote_utask(command, job_type):
131+
# TODO(metzman): This is really complicated because of the need to test
132+
# remote execution. This is no longer a need, so simplify this.
133+
if not (environment.is_tworker() or is_remote_utask(command, job_type)):
132134
self.execute_locally(task_argument, job_type, uworker_env)
133135
return
134136

0 commit comments

Comments
 (0)