-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix task event handler start time #3325
Fix task event handler start time #3325
Conversation
@@ -792,7 +792,6 @@ def _process_message_submit_failed(self, itask, event_time): | |||
self.setup_event_handlers( | |||
itask, self.EVENT_SUBMIT_RETRY, | |||
"job %s, %s" % (self.EVENT_SUBMIT_FAILED, delay_msg)) | |||
self.job_pool.set_job_state(job_d, TASK_STATUS_SUBMIT_RETRYING) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The submit retrying status is a task status, not a job status.
self.suite_db_mgr.put_update_task_jobs(itask, { | ||
"time_run": itask.summary['started_time_string']}) | ||
if itask.state.reset(TASK_STATUS_RUNNING): | ||
self.setup_event_handlers(itask, 'started', 'job started') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The start time is now set before we set up the started event handler.
@@ -680,6 +680,7 @@ def _process_message_failed(self, itask, event_time, message): | |||
itask.set_summary_time('finished', event_time) | |||
job_d = get_task_job_id(itask.point, itask.tdef.name, itask.submit_num) | |||
self.job_pool.set_job_time(job_d, 'finished', event_time) | |||
self.job_pool.set_job_state(job_d, TASK_STATUS_FAILED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Job status is failed, regardless of task retrying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2b696fb
to
56e52ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good; in the job_pool.py
could you remove TASK_STATUS_SUBMIT_RETRYING
from the import and job states list:
JOB_STATUSES_ALL = [
TASK_STATUS_READY,
TASK_STATUS_SUBMITTED,
TASK_STATUS_SUBMIT_FAILED,
TASK_STATUS_SUBMIT_RETRYING,
TASK_STATUS_RUNNING,
TASK_STATUS_SUCCEEDED,
TASK_STATUS_FAILED,
]
If you think ready
state doesn't make sense (as I thought of it as "job file ready"), perhaps we could address that also? (although maybe the new submitting
state would be appropriate in the related PR)
The `start_time` is now available as a template key for task event handler. Also rearranged a few statements (for recording the job status) in `cylc.flow.task_events_mgr` for consistency.
56e52ac
to
5cf0613
Compare
@dwsutherland Done what you requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The
start_time
is now available as a template key for task event handler.Also rearranged a few statements (for recording the job status) in
cylc.flow.task_events_mgr
for consistency.These changes close #2757, (see #2757 (comment)).
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.