Skip to content

Commit c2f2297

Browse files
committed
check if start time is missing, output warning
1 parent 7f0830f commit c2f2297

File tree

1 file changed

+13
-0
lines changed
  • services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler

1 file changed

+13
-0
lines changed

services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/_scheduler_base.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,19 @@ async def _send_running_tasks_heartbeat(
321321
def _need_heartbeat(task: CompTaskAtDB) -> bool:
322322
if task.state not in RUNNING_STATES:
323323
return False
324+
if task.start is None:
325+
_logger.warning(
326+
"Task %s is in state %s but has no start time. This should not happen. Skipping heartbeat as this cannot be computed. (%s, %s, %s, %s, %s)",
327+
task.job_id,
328+
task.state,
329+
user_id,
330+
project_id,
331+
iteration,
332+
run_id,
333+
task.node_id,
334+
)
335+
return False
336+
324337
if task.last_heartbeat is None:
325338
assert task.start # nosec
326339
return bool(

0 commit comments

Comments
 (0)