https://prefect.io logo
Title
d

Dave

11/10/2020, 10:08 AM
Hi guys, Just found a issue when you change the state of your flow in UI, fx if a flow failed and you change the state to success. After you mark is as failed it would then get a new duration time, if you check my screenshot you can see the job finished 9:02 AM and marked it ass success around 53 minutes after and it got a new duration. If it isn't a bug, then please tell me why you chose this approach, thanks.
j

Jenny

11/10/2020, 3:38 PM
Hi @Dave - the UI is displaying the duration between when the flow started and when it ended (
start_time
 and 
end_time
 on the flow run object); if you need more granular control over what should be included to calculate metrics etc you might be better using task run or flow run state history. We're always open to how we might better give metrics and information so if you have ideas over how we might better show runtime, please do open a ticket for discussion in the UI repo. Also - would you mind moving the stack trace and image into this thread? It makes it easier for us to scroll through and see everyone's questions if the initial message is shorter. Thanks!
❤️ 1
d

Dave

11/10/2020, 5:51 PM
I'm running:
prefect diagnostics:
{
  "config_overrides": {},
  "env_vars": [],
  "system_information": {
    "platform": "Linux-5.4.0-1031-azure-x86_64-with-glibc2.29",
    "prefect_backend": "server",
    "prefect_version": "0.13.14",
    "python_version": "3.8.5"
  }
}
If you check the logs you can also see I marked it as success.
10 November 2020,09:02:54 	Agent01	INFO	Submitted for execution: PID: 2907
10 November 2020,09:02:54 	prefect.CloudFlowRunner	INFO	Beginning Flow run for 'post_msg_slack'
10 November 2020,09:02:54 	prefect.CloudTaskRunner	INFO	Task 'SlackMsg': Starting task run...
10 November 2020,09:02:55 	prefect.CloudTaskRunner	INFO	Task 'SlackMsg': Finished task run for task with final state: 'Success'
10 November 2020,09:02:55 	prefect.CloudTaskRunner	INFO	Task 'post': Starting task run...
10 November 2020,09:02:55 	prefect.CloudTaskRunner	ERROR	Unexpected error: Exception('Throw Error!')
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/prefect/engine/runner.py", line 48, in inner
    new_state = method(self, state, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/prefect/engine/task_runner.py", line 845, in get_task_run_state
    value = prefect.utilities.executors.run_task_with_timeout(
  File "/usr/local/lib/python3.8/site-packages/prefect/utilities/executors.py", line 298, in run_task_with_timeout
    return task.run(*args, **kwargs)  # type: ignore
  File "post_msg.py", line 12, in post
Exception: Throw Error!
10 November 2020,09:02:55 	prefect.CloudTaskRunner	INFO	Task 'post': Finished task run for task with final state: 'Failed'
10 November 2020,09:02:55 	prefect.CloudFlowRunner	INFO	Flow run FAILED: some reference tasks failed.
10 November 2020,09:56:10 	PrefectUIRunMarkAsButton	INFO	User marked flow run as Success
j

Jenny

11/10/2020, 5:56 PM
Thank you! 🚀
d

Dave

11/10/2020, 6:07 PM
Gracias for the answer, I’ll do that next time 👏🏻 Having trouble with the image.