oda-hub / dispatcher-app

Other
2 stars 2 forks source link

Align the way the job_monitor is read between `job` and `OsaJob` #681

Closed burnout87 closed 6 months ago

burnout87 commented 6 months ago

When resubmitting an uncompleted request, which was in the progress status (and therefore, on the frontend, the progress bar was partially filled), we get the correct status returned, progress, but no update on its progress value since the full_report_dict would not be present. This causes the progress bar to be empty, until the job completes.

This happens because the read job_monitor.json file, is the one of the aliased folder (_aliased), and its job_monitor file is not directly updated with the progress status (ie there is no full_report_dict) by the call_back call from the backend.

The job_monitor is read with the function updated_dataserver_monitor, and this is different between the Job class and the OsaJob one: in the first case the job_monitor is always extracted reading from file_path, whereas for the latter always from work_dir (reading also the node files if present).

Job

https://github.com/oda-hub/dispatcher-app/blob/a01e05c19fd76ec6c01dc1237d5c4f7e40177c60/cdci_data_analysis/analysis/job_manager.py#L174-L187

OsaJob

https://github.com/oda-hub/dispatcher-app/blob/a01e05c19fd76ec6c01dc1237d5c4f7e40177c60/cdci_data_analysis/analysis/job_manager.py#L312-L373

Now, when the job is aliased, the work_dir attr of the job object is updated and it uses the original scratch dir (not aliased), but the file_path is never. Thus causing a job_monitor not containing any full_report_dict to be returned, thus issue.