-
Notifications
You must be signed in to change notification settings - Fork 94
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
data store: preparing jobs appearing on restart #4994
Comments
Actually it predates #4984 |
Because jobs exist before submission, and had to have some sort of state, so they are assigned on DB load according to their attributes:
If the workflow shutdown before updating the status of the job in the DB, or the status never got followed up on, then the job will be in this |
Hmm, in that case do we need either: Option 2. has been discussed and decided against, but it's not entirely unreasonable - "preparing" is not that much more abstract than "submitted" as a job state (submitted does not represent a running process yet either, although it does have a job ID at that point). |
I think option 1 (exclude preparing jobs from the data store) is straightforward, essentially boils down to @@ @@ def insert_db_job(self, row_idx, row):
if run_status is not None:
if run_status == 0:
status = TASK_STATUS_SUCCEEDED
else:
status = TASK_STATUS_FAILED
elif time_run is not None:
status = TASK_STATUS_RUNNING
elif submit_status is not None:
if submit_status == 0:
status = TASK_STATUS_SUBMITTED
else:
status = TASK_STATUS_SUBMIT_FAILED
else:
- status = TASK_STATUS_PREPARING
+ return (keeps the the historical failed tasks in the store) |
NOOOO!
^ This. |
Fair enough, but as I said, it wouldn't be entirely unreasonable, it's just a choice 😁 |
We may have missing job history (i.e. "why can I only see job |
We can't just "sweep it under the rug" I'm afraid. The DB load isn't the only place we have to contend with a
And we can't just do away with jobs here (live/new jobs)... So if it's not |
Maybe a |
Well that's exactly what "preparing" means 😁 |
Sounds sensible, it can't be nothing (since the submit num is incremented), and it can't be submitted (as that means it's been handed off to the runner successfully). Some job states are tasks states also, so they don't necessarily have to be different 😄 |
If we really don't want Otherwise, we should just add an icon to the UI. |
Surely it's just a single if branch that returns if the task state is preparing? |
Reported by @MetRonnie on Element.
"Preparing" is a task state not a job state, we should see preparing tasks but never preparing jobs (jobs represent submissions, they have IDs and can be queried).
It looks like this only happens on restart but that will need to be confirmed properly. The data store loads in jobs from the DB and
is probably being tricked by the submit number being higher than expected as a result of #4984- #4994 (comment)The code needs to be patched to prevent these preparing jobs from being spawned somewhere around here:
cylc-flow/cylc/flow/data_store_mgr.py
Lines 883 to 886 in e085c22
Pull requests welcome!
This is an Open Source project - please consider contributing a bug fix
yourself (please read
CONTRIBUTING.md
before starting any work though).The text was updated successfully, but these errors were encountered: