@@ -823,11 +823,19 @@ async def _schedule_tasks_to_start( # noqa: C901
823823 except (
824824 ComputationalBackendNotConnectedError ,
825825 ComputationalSchedulerChangedError ,
826+ ClustersKeeperNotAvailableError ,
826827 ):
827828 _logger .exception (
828829 "Issue with computational backend. Tasks are set back "
829830 "to WAITING_FOR_CLUSTER state until scheduler comes back!" ,
830831 )
832+ await publish_project_log (
833+ self .rabbitmq_client ,
834+ user_id ,
835+ project_id ,
836+ log = "Unexpected error while scheduling computational tasks! TIP: contact osparc support if this does not resolve automatically." ,
837+ log_level = logging .ERROR ,
838+ )
831839 await CompTasksRepository .instance (
832840 self .db_engine
833841 ).update_project_tasks_state (
@@ -861,29 +869,6 @@ async def _schedule_tasks_to_start( # noqa: C901
861869 )
862870 for task in tasks_ready_to_start :
863871 comp_tasks [f"{ task } " ].state = RunningState .WAITING_FOR_CLUSTER
864- except ClustersKeeperNotAvailableError :
865- _logger .exception ("Unexpected error while starting tasks:" )
866- await publish_project_log (
867- self .rabbitmq_client ,
868- user_id ,
869- project_id ,
870- log = "Unexpected error while scheduling computational tasks! TIP: contact osparc support." ,
871- log_level = logging .ERROR ,
872- )
873-
874- await CompTasksRepository .instance (
875- self .db_engine
876- ).update_project_tasks_state (
877- project_id ,
878- comp_run .run_id ,
879- list (tasks_ready_to_start .keys ()),
880- RunningState .FAILED ,
881- optional_progress = 1.0 ,
882- optional_stopped = arrow .utcnow ().datetime ,
883- )
884- for task in tasks_ready_to_start :
885- comp_tasks [f"{ task } " ].state = RunningState .FAILED
886- raise
887872 except TaskSchedulingError as exc :
888873 _logger .exception (
889874 "Project '%s''s task '%s' could not be scheduled" ,
0 commit comments