cylc-flow
cylc-flow copied to clipboard
workflow-state: check lastest instance for status
The task_states DB table gets a new entry for a given task ID if its flow numbers change. That's because we use the table to extract flow-wait status for historical tasks that already ran in this flow.
(For a given flow, the submit number of a task ID updates but we don't get a new entry).
cylc workflow-state
wrongly assumes that any non-null query result indicates status achieved. It should only check the result for the latest matching record in the table (i.e. latest submit number).