Skip to content

Commit

Permalink
Enhance error messages of synapse jobs (feathr-ai#855)
Browse files Browse the repository at this point in the history
* Enhance error messages of synapse jobs
  • Loading branch information
enya-yx authored Nov 14, 2022
1 parent 5903842 commit 4e60297
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions feathr_project/feathr/spark_provider/_synapse_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def submit_feathr_job(self, job_name: str, main_jar_path: str = None, main_clas
def wait_for_completion(self, timeout_seconds: Optional[float]) -> bool:
"""
Returns true if the job completed successfully
"""
"""
start_time = time.time()
while (timeout_seconds is None) or (time.time() - start_time < timeout_seconds):
status = self.get_status()
Expand All @@ -179,7 +179,9 @@ def wait_for_completion(self, timeout_seconds: Optional[float]) -> bool:
return True
elif status in {LivyStates.ERROR.value, LivyStates.DEAD.value, LivyStates.KILLED.value}:
logger.error("Feathr job has failed.")
logger.error(self._api.get_driver_log(self.current_job_info.id).decode('utf-8'))
error_msg = self._api.get_driver_log(self.current_job_info.id).decode('utf-8')
logger.error(error_msg)
logger.error("The size of the whole error log is: {}. The logs might be truncated in some cases (such as in Visual Studio Code) so only the top a few lines of the error message is displayed. If you cannot see the whole log, you may want to extend the setting for output size limit.", len(error_msg))
return False
else:
time.sleep(30)
Expand Down

0 comments on commit 4e60297

Please sign in to comment.