Skip to content

[fix](job scheduler) Record task finish time on execution failure - #66232

Open
yujun777 wants to merge 1 commit into
apache:masterfrom
yujun777:fix-mtmv-task-finish-time
Open

[fix](job scheduler) Record task finish time on execution failure#66232
yujun777 wants to merge 1 commit into
apache:masterfrom
yujun777:fix-mtmv-task-finish-time

Conversation

@yujun777

@yujun777 yujun777 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

When a task fails through the execution exception path, AbstractTask.runTask() calls the no-argument onFail(), which marked the task FAILED without recording finishTimeMs. MTMV failed refresh tasks therefore exposed an empty FinishTime and could not calculate DurationMs.

relate PR: #27703

What changes were made?

  • Record finishTimeMs when AbstractTask.onFail() transitions a task to FAILED.
  • Add a regression unit test covering the runTask() exception path and preserving the error message.

Testing

  • AbstractJobStatusTest: 13 tests passed.

Record the finish time when a task enters FAILED through the execution exception path, so MTMV failures expose complete terminal metadata and a usable duration.

Key changes:
- Set finishTimeMs in AbstractTask.onFail().
- Cover runTask() exception handling in AbstractJobStatusTest.

Unit Test:
- AbstractJobStatusTest: 13 tests passed.
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@yujun777

Copy link
Copy Markdown
Contributor Author

run buildall

@morrySnow morrySnow changed the title [fix](fe) Record task finish time on execution failure [fix](job scheduler) Record task finish time on execution failure Jul 29, 2026
@morrySnow

Copy link
Copy Markdown
Contributor

Add the PR that introduces the issue to the "related pr" section

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 29483 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 90381bc804de4084ff7fe9f7b3b73ea5019dae3a, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17645	4026	4014	4014
q2	1992	323	202	202
q3	10281	1414	844	844
q4	4712	468	340	340
q5	7618	876	575	575
q6	213	169	140	140
q7	742	805	608	608
q8	10009	1579	1620	1579
q9	6074	4311	4291	4291
q10	6793	1732	1453	1453
q11	517	355	342	342
q12	750	592	472	472
q13	18083	3369	2731	2731
q14	273	261	241	241
q15	q16	778	768	716	716
q17	947	1041	980	980
q18	7020	5741	5619	5619
q19	1367	1353	1108	1108
q20	848	676	583	583
q21	5831	2689	2342	2342
q22	425	360	303	303
Total cold run time: 102918 ms
Total hot run time: 29483 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4588	4548	4355	4355
q2	288	313	209	209
q3	4583	4953	4394	4394
q4	2079	2304	1364	1364
q5	4386	4330	4322	4322
q6	235	184	126	126
q7	2032	1906	1666	1666
q8	2523	2193	2132	2132
q9	7850	7815	7762	7762
q10	4677	4710	4189	4189
q11	765	403	402	402
q12	756	776	553	553
q13	3234	3594	3072	3072
q14	319	305	286	286
q15	q16	724	739	644	644
q17	1399	1365	1356	1356
q18	8075	7557	7039	7039
q19	1113	1068	1078	1068
q20	2234	2219	1943	1943
q21	5242	4583	4481	4481
q22	547	460	432	432
Total cold run time: 57649 ms
Total hot run time: 51795 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 177248 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 90381bc804de4084ff7fe9f7b3b73ea5019dae3a, data reload: false

query5	4342	622	487	487
query6	489	220	200	200
query7	4887	586	334	334
query8	351	199	172	172
query9	8785	4181	4163	4163
query10	500	358	312	312
query11	5899	2309	2132	2132
query12	162	105	110	105
query13	1276	619	463	463
query14	6276	5213	4891	4891
query14_1	4261	4230	4234	4230
query15	209	239	175	175
query16	1037	461	437	437
query17	1098	690	556	556
query18	2574	470	331	331
query19	204	190	142	142
query20	108	107	107	107
query21	233	156	134	134
query22	13512	13568	13318	13318
query23	17298	16433	16032	16032
query23_1	16327	16255	16315	16255
query24	7448	1773	1280	1280
query24_1	1335	1305	1271	1271
query25	548	449	368	368
query26	1849	351	224	224
query27	2572	581	368	368
query28	4911	2088	2081	2081
query29	1054	611	476	476
query30	347	271	229	229
query31	1129	1103	982	982
query32	111	64	62	62
query33	539	336	260	260
query34	1179	1115	682	682
query35	765	813	695	695
query36	1013	1013	874	874
query37	162	121	96	96
query38	1889	1714	1642	1642
query39	875	861	860	860
query39_1	865	833	846	833
query40	257	174	153	153
query41	76	70	69	69
query42	100	96	94	94
query43	332	342	296	296
query44	1526	772	758	758
query45	193	189	177	177
query46	1099	1179	721	721
query47	2081	2073	1997	1997
query48	410	415	284	284
query49	572	413	301	301
query50	1072	448	354	354
query51	10683	10437	10718	10437
query52	89	91	80	80
query53	265	288	206	206
query54	296	236	218	218
query55	75	70	65	65
query56	283	282	282	282
query57	1310	1263	1171	1171
query58	277	267	253	253
query59	1616	1681	1427	1427
query60	298	271	253	253
query61	152	151	147	147
query62	540	499	423	423
query63	243	204	203	203
query64	2811	1036	861	861
query65	4707	4676	4613	4613
query66	1812	501	385	385
query67	29171	29262	29110	29110
query68	3250	1523	1068	1068
query69	426	368	264	264
query70	938	841	805	805
query71	385	350	312	312
query72	3085	2645	2385	2385
query73	872	808	440	440
query74	5077	4929	4723	4723
query75	2533	2501	2133	2133
query76	2325	1205	771	771
query77	360	382	294	294
query78	11848	11771	11262	11262
query79	1397	1162	760	760
query80	688	554	471	471
query81	451	327	301	301
query82	591	158	123	123
query83	397	330	291	291
query84	274	162	134	134
query85	924	605	527	527
query86	329	253	238	238
query87	1827	1828	1774	1774
query88	3822	2842	2813	2813
query89	453	370	321	321
query90	1869	203	206	203
query91	208	191	165	165
query92	66	61	58	58
query93	1653	1529	956	956
query94	563	348	293	293
query95	783	573	490	490
query96	1044	771	371	371
query97	2634	2619	2490	2490
query98	218	213	204	204
query99	1082	1117	967	967
Total cold run time: 263609 ms
Total hot run time: 177248 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.2 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 90381bc804de4084ff7fe9f7b3b73ea5019dae3a, data reload: false

query1	0.00	0.00	0.00
query2	0.09	0.05	0.05
query3	0.28	0.13	0.13
query4	1.61	0.14	0.14
query5	0.24	0.22	0.22
query6	1.22	1.09	1.09
query7	0.04	0.01	0.00
query8	0.06	0.04	0.04
query9	0.40	0.32	0.32
query10	0.58	0.61	0.55
query11	0.20	0.14	0.14
query12	0.18	0.15	0.15
query13	0.48	0.48	0.48
query14	1.03	1.02	1.02
query15	0.62	0.60	0.60
query16	0.32	0.35	0.32
query17	1.15	1.11	1.19
query18	0.23	0.22	0.20
query19	2.04	1.92	1.92
query20	0.02	0.01	0.02
query21	15.43	0.21	0.13
query22	4.87	0.06	0.05
query23	16.12	0.31	0.12
query24	2.94	0.40	0.32
query25	0.12	0.05	0.05
query26	0.74	0.21	0.14
query27	0.05	0.03	0.03
query28	3.47	0.89	0.55
query29	12.50	4.05	3.30
query30	0.27	0.15	0.17
query31	2.77	0.60	0.33
query32	3.22	0.59	0.49
query33	3.35	3.21	3.17
query34	15.64	4.23	3.53
query35	3.56	3.55	3.54
query36	0.55	0.44	0.43
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.16	0.16
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.92 s
Total hot run time: 25.2 s

@yujun777

Copy link
Copy Markdown
Contributor Author

run feut

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 4.76% (1/21) 🎉
Increment coverage report
Complete coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/3.1.x dev/4.0.x dev/4.1.x reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants