Skip to content

Conversation

@CalvinKirs
Copy link
Member

@CalvinKirs CalvinKirs commented Mar 28, 2025

Description:

This PR ensures that system resources, such as thread pools, are properly closed when a catalog is dropped. Previously, these resources were not explicitly released, which could lead to potential resource leaks.

Changes:

Implemented close() method in the catalog to release system resources.

Ensured that thread pools and other managed resources are properly shut down when dropping a catalog.

Added necessary cleanup logic in the dropCatalog method.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas
Copy link
Contributor

Thearas commented Mar 28, 2025

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?

@CalvinKirs
Copy link
Member Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 34055 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 6a1fd719ccd209e940ea939db649b64bbf287ad6, data reload: false

------ Round 1 ----------------------------------
q1	25680	5744	5029	5029
q2	2079	306	168	168
q3	10383	1236	685	685
q4	10242	994	517	517
q5	7519	2318	2384	2318
q6	189	165	132	132
q7	902	751	607	607
q8	9314	1329	1149	1149
q9	6722	5108	5077	5077
q10	6816	2306	1896	1896
q11	465	273	256	256
q12	355	357	217	217
q13	17756	3685	3116	3116
q14	228	223	211	211
q15	568	484	489	484
q16	634	634	588	588
q17	594	849	348	348
q18	7654	7164	7100	7100
q19	1675	955	566	566
q20	334	340	199	199
q21	4116	2601	2414	2414
q22	1010	1034	978	978
Total cold run time: 115235 ms
Total hot run time: 34055 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5210	5122	5175	5122
q2	235	320	226	226
q3	2165	2621	2258	2258
q4	1473	1814	1402	1402
q5	4524	4462	4388	4388
q6	210	160	122	122
q7	1973	1890	1721	1721
q8	2559	2486	2480	2480
q9	7151	7080	7148	7080
q10	2977	3165	2734	2734
q11	581	490	472	472
q12	698	733	585	585
q13	3431	3834	3326	3326
q14	283	280	275	275
q15	532	469	459	459
q16	658	686	664	664
q17	1153	1571	1373	1373
q18	7640	7512	7484	7484
q19	857	851	1034	851
q20	1988	2013	1860	1860
q21	5302	4742	4618	4618
q22	1068	1043	981	981
Total cold run time: 52668 ms
Total hot run time: 50481 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 182811 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 6a1fd719ccd209e940ea939db649b64bbf287ad6, data reload: false

query1	1008	472	459	459
query2	6553	1923	1851	1851
query3	6807	218	214	214
query4	26476	23857	22814	22814
query5	4359	653	483	483
query6	300	221	193	193
query7	4609	485	282	282
query8	299	246	257	246
query9	8600	2550	2540	2540
query10	498	324	255	255
query11	15436	15220	14999	14999
query12	160	114	108	108
query13	1657	518	394	394
query14	9453	6127	6213	6127
query15	214	192	167	167
query16	7716	630	488	488
query17	1199	729	565	565
query18	2022	422	314	314
query19	196	190	167	167
query20	124	121	122	121
query21	212	121	102	102
query22	4221	4234	4080	4080
query23	33595	32900	32954	32900
query24	8441	2397	2353	2353
query25	518	454	394	394
query26	1226	262	145	145
query27	2733	506	320	320
query28	4322	2397	2382	2382
query29	694	558	425	425
query30	283	215	189	189
query31	960	868	735	735
query32	75	65	62	62
query33	548	359	315	315
query34	793	850	499	499
query35	787	815	801	801
query36	932	960	888	888
query37	115	96	75	75
query38	4156	4115	3996	3996
query39	1424	1456	1408	1408
query40	200	120	102	102
query41	56	51	52	51
query42	127	104	106	104
query43	505	515	481	481
query44	1375	806	796	796
query45	174	177	162	162
query46	842	1019	640	640
query47	1755	1833	1728	1728
query48	382	408	319	319
query49	781	491	418	418
query50	694	730	410	410
query51	4228	4196	4091	4091
query52	109	110	97	97
query53	230	253	191	191
query54	495	490	408	408
query55	84	83	80	80
query56	279	290	251	251
query57	1130	1151	1094	1094
query58	242	241	238	238
query59	2487	2784	2610	2610
query60	294	289	269	269
query61	134	129	131	129
query62	783	725	652	652
query63	214	186	181	181
query64	4200	995	728	728
query65	4354	4278	4269	4269
query66	1061	409	302	302
query67	15818	15606	15219	15219
query68	8322	899	516	516
query69	476	340	265	265
query70	1229	1081	1025	1025
query71	485	314	270	270
query72	5702	4666	2309	2309
query73	716	604	348	348
query74	8836	8886	8775	8775
query75	3880	3218	2729	2729
query76	3717	1163	761	761
query77	790	366	282	282
query78	9907	10195	9236	9236
query79	2146	824	574	574
query80	603	522	453	453
query81	490	255	224	224
query82	483	140	99	99
query83	260	178	165	165
query84	255	94	75	75
query85	791	363	309	309
query86	387	316	279	279
query87	4689	4625	4333	4333
query88	3754	2242	2224	2224
query89	387	313	271	271
query90	1852	212	217	212
query91	145	141	111	111
query92	79	61	58	58
query93	1589	1058	591	591
query94	657	424	311	311
query95	361	271	266	266
query96	494	572	279	279
query97	3169	3258	3120	3120
query98	233	210	239	210
query99	1418	1413	1255	1255
Total cold run time: 275056 ms
Total hot run time: 182811 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.81 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 6a1fd719ccd209e940ea939db649b64bbf287ad6, data reload: false

query1	0.03	0.04	0.03
query2	0.12	0.11	0.09
query3	0.25	0.19	0.18
query4	1.61	0.19	0.18
query5	0.57	0.55	0.56
query6	1.23	0.70	0.72
query7	0.03	0.02	0.02
query8	0.05	0.04	0.03
query9	0.56	0.53	0.52
query10	0.62	0.56	0.56
query11	0.16	0.10	0.11
query12	0.14	0.12	0.11
query13	0.62	0.60	0.60
query14	2.67	2.86	2.83
query15	0.94	0.85	0.85
query16	0.37	0.39	0.38
query17	1.03	1.03	1.04
query18	0.21	0.21	0.20
query19	2.04	1.82	1.86
query20	0.01	0.01	0.01
query21	15.35	0.90	0.55
query22	0.77	1.13	0.61
query23	15.04	1.36	0.62
query24	6.85	2.23	0.57
query25	0.52	0.24	0.08
query26	0.55	0.17	0.13
query27	0.05	0.05	0.05
query28	9.30	0.81	0.43
query29	12.61	3.96	3.31
query30	0.25	0.09	0.06
query31	2.82	0.58	0.38
query32	3.22	0.55	0.47
query33	3.08	3.03	3.10
query34	15.75	5.09	4.46
query35	4.55	4.46	4.50
query36	0.66	0.49	0.47
query37	0.08	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.17	0.13	0.13
query41	0.08	0.03	0.03
query42	0.03	0.02	0.03
query43	0.04	0.04	0.03
Total cold run time: 105.11 s
Total hot run time: 30.81 s

### Description:
This PR ensures that system resources, such as thread pools, are properly closed when a catalog is dropped. Previously, these resources were not explicitly released, which could lead to potential resource leaks.

### Changes:
Implemented close() method in the catalog to release system resources.

Ensured that thread pools and other managed resources are properly shut down when dropping a catalog.

Added necessary cleanup logic in the dropCatalog method.
morningman
morningman previously approved these changes Mar 28, 2025
@CalvinKirs
Copy link
Member Author

run buildall

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 28, 2025
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

TPC-H: Total hot run time: 34068 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 4ad16db7957c55c5b05ce87ec450f6d057d4e65b, data reload: false

------ Round 1 ----------------------------------
q1	25564	5072	5001	5001
q2	2068	285	180	180
q3	10390	1234	705	705
q4	10217	965	538	538
q5	7543	2335	2350	2335
q6	193	163	139	139
q7	918	759	651	651
q8	9318	1251	1108	1108
q9	6705	5063	5087	5063
q10	6786	2296	1902	1902
q11	459	275	265	265
q12	345	351	233	233
q13	17758	3655	3124	3124
q14	236	229	226	226
q15	535	496	494	494
q16	626	618	600	600
q17	574	851	349	349
q18	7440	7082	7055	7055
q19	1329	939	563	563
q20	329	337	198	198
q21	3728	3304	2400	2400
q22	1056	1003	939	939
Total cold run time: 114117 ms
Total hot run time: 34068 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5128	5076	5102	5076
q2	233	323	233	233
q3	2119	2616	2308	2308
q4	1399	1816	1406	1406
q5	4357	4432	4396	4396
q6	217	168	130	130
q7	2006	1908	1745	1745
q8	2567	2595	2564	2564
q9	7376	7297	6912	6912
q10	3031	3217	2790	2790
q11	573	514	481	481
q12	696	783	606	606
q13	3471	3877	3289	3289
q14	269	294	285	285
q15	546	501	514	501
q16	655	679	656	656
q17	1139	1527	1421	1421
q18	7613	7501	7380	7380
q19	799	803	798	798
q20	2001	2054	1864	1864
q21	5206	4865	4892	4865
q22	1095	1078	1023	1023
Total cold run time: 52496 ms
Total hot run time: 50729 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192466 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 4ad16db7957c55c5b05ce87ec450f6d057d4e65b, data reload: false

query1	1386	1073	1032	1032
query2	6151	1917	1886	1886
query3	11180	4709	4539	4539
query4	54317	25866	23333	23333
query5	5073	540	463	463
query6	334	192	180	180
query7	4870	497	277	277
query8	312	231	213	213
query9	5346	2543	2548	2543
query10	441	315	256	256
query11	15192	14992	14840	14840
query12	160	112	103	103
query13	1027	508	411	411
query14	10215	6667	6308	6308
query15	193	196	172	172
query16	7072	673	531	531
query17	1098	696	565	565
query18	1533	413	324	324
query19	196	185	172	172
query20	144	129	120	120
query21	206	128	105	105
query22	4590	4449	4400	4400
query23	33830	33250	33238	33238
query24	6650	2427	2447	2427
query25	450	463	411	411
query26	704	265	148	148
query27	2228	502	330	330
query28	3279	2444	2449	2444
query29	592	565	420	420
query30	301	224	198	198
query31	852	891	788	788
query32	76	63	64	63
query33	454	372	324	324
query34	766	854	498	498
query35	817	830	754	754
query36	950	983	904	904
query37	121	98	78	78
query38	4294	4234	4138	4138
query39	1496	1461	1427	1427
query40	211	122	107	107
query41	54	54	50	50
query42	126	107	101	101
query43	505	526	490	490
query44	1331	835	815	815
query45	194	178	167	167
query46	850	1046	653	653
query47	1850	1896	1836	1836
query48	399	413	322	322
query49	685	511	428	428
query50	700	758	428	428
query51	4271	4297	4156	4156
query52	115	104	98	98
query53	223	255	181	181
query54	487	514	420	420
query55	87	84	84	84
query56	302	279	283	279
query57	1206	1234	1135	1135
query58	264	251	263	251
query59	2720	2875	2666	2666
query60	311	306	272	272
query61	151	165	145	145
query62	757	757	679	679
query63	223	194	184	184
query64	1612	1055	717	717
query65	4486	4393	4324	4324
query66	758	390	290	290
query67	15850	15684	15301	15301
query68	7527	872	508	508
query69	536	297	276	276
query70	1180	1104	1092	1092
query71	493	288	279	279
query72	5894	4929	4958	4929
query73	1495	706	343	343
query74	9125	9147	8662	8662
query75	3774	3261	2732	2732
query76	4176	1188	754	754
query77	625	363	284	284
query78	10058	10035	9329	9329
query79	2574	843	568	568
query80	675	513	440	440
query81	475	248	226	226
query82	459	123	102	102
query83	310	175	152	152
query84	288	91	73	73
query85	800	360	308	308
query86	395	295	308	295
query87	4429	4470	4294	4294
query88	3478	2228	2262	2228
query89	445	306	276	276
query90	1784	206	202	202
query91	145	145	110	110
query92	73	56	54	54
query93	1998	1045	580	580
query94	652	412	308	308
query95	359	278	264	264
query96	477	561	279	279
query97	3175	3250	3115	3115
query98	235	207	201	201
query99	1439	1385	1261	1261
Total cold run time: 299172 ms
Total hot run time: 192466 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 31.44 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 4ad16db7957c55c5b05ce87ec450f6d057d4e65b, data reload: false

query1	0.04	0.04	0.03
query2	0.12	0.10	0.10
query3	0.25	0.19	0.20
query4	1.59	0.19	0.19
query5	0.59	0.58	0.57
query6	1.18	0.71	0.71
query7	0.02	0.01	0.02
query8	0.04	0.03	0.04
query9	0.59	0.52	0.51
query10	0.58	0.59	0.57
query11	0.16	0.12	0.10
query12	0.14	0.11	0.11
query13	0.61	0.60	0.60
query14	2.79	2.66	2.82
query15	0.94	0.85	0.85
query16	0.37	0.39	0.38
query17	1.07	1.05	1.06
query18	0.21	0.20	0.19
query19	1.92	1.95	1.86
query20	0.01	0.01	0.02
query21	15.35	0.92	0.56
query22	0.74	1.05	0.87
query23	14.83	1.37	0.62
query24	7.49	1.42	0.80
query25	0.46	0.15	0.09
query26	0.75	0.16	0.13
query27	0.05	0.05	0.04
query28	9.57	0.88	0.44
query29	12.57	4.01	3.33
query30	0.25	0.09	0.06
query31	2.83	0.56	0.37
query32	3.22	0.55	0.47
query33	2.94	3.08	3.04
query34	15.80	5.11	4.53
query35	4.58	4.57	4.56
query36	0.68	0.50	0.48
query37	0.08	0.06	0.07
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.18	0.14	0.13
query41	0.08	0.03	0.03
query42	0.04	0.03	0.02
query43	0.04	0.03	0.03
Total cold run time: 105.83 s
Total hot run time: 31.44 s

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Mar 28, 2025
@CalvinKirs
Copy link
Member Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	25809	5007	4962	4962
q2	2078	277	158	158
q3	10420	1230	704	704
q4	10229	995	528	528
q5	7514	2283	2398	2283
q6	190	165	131	131
q7	904	746	602	602
q8	9318	1239	1069	1069
q9	6821	5106	5068	5068
q10	6801	2313	1874	1874
q11	474	269	270	269
q12	343	354	223	223
q13	17750	3682	3013	3013
q14	235	236	213	213
q15	545	489	491	489
q16	616	631	580	580
q17	562	858	337	337
q18	7523	7056	7287	7056
q19	1326	932	558	558
q20	323	323	201	201
q21	3775	3329	2360	2360
q22	1053	1008	937	937
Total cold run time: 114609 ms
Total hot run time: 33615 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5089	5061	5047	5047
q2	236	323	240	240
q3	2127	2623	2253	2253
q4	1428	1811	1399	1399
q5	4380	4375	4386	4375
q6	229	170	125	125
q7	2006	1912	1775	1775
q8	2577	2522	2516	2516
q9	7268	7213	7005	7005
q10	2985	3184	2724	2724
q11	564	504	499	499
q12	661	771	623	623
q13	3555	3923	3327	3327
q14	305	307	287	287
q15	553	513	519	513
q16	646	711	642	642
q17	1164	1612	1407	1407
q18	7907	7699	7363	7363
q19	805	769	990	769
q20	2060	2029	1804	1804
q21	5170	4860	4807	4807
q22	1092	1049	1029	1029
Total cold run time: 52807 ms
Total hot run time: 50529 ms

zy-kkk
zy-kkk previously approved these changes Mar 31, 2025
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 31, 2025
@doris-robot
Copy link

TPC-DS: Total hot run time: 191834 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 f43c3ff3d5f9902febd0a93a291e83234532724d, data reload: false

query1	1389	1061	1029	1029
query2	6438	1994	1953	1953
query3	11149	4565	4509	4509
query4	25831	23695	22846	22846
query5	3766	640	474	474
query6	291	183	191	183
query7	3980	502	280	280
query8	314	253	239	239
query9	8512	2534	2503	2503
query10	454	311	253	253
query11	15326	15048	14838	14838
query12	154	108	113	108
query13	1566	524	412	412
query14	8740	6207	6111	6111
query15	213	190	167	167
query16	7184	644	471	471
query17	1223	711	559	559
query18	1989	433	332	332
query19	212	199	163	163
query20	127	127	122	122
query21	207	128	108	108
query22	4605	4468	4432	4432
query23	34838	33467	33291	33291
query24	8527	2451	2398	2398
query25	538	469	404	404
query26	1211	266	140	140
query27	3013	493	325	325
query28	4488	2418	2415	2415
query29	764	577	444	444
query30	274	228	198	198
query31	921	861	822	822
query32	79	70	61	61
query33	536	378	306	306
query34	775	850	522	522
query35	795	846	764	764
query36	976	1015	939	939
query37	124	106	87	87
query38	4165	4156	4116	4116
query39	1475	1449	1587	1449
query40	213	121	103	103
query41	53	53	52	52
query42	119	106	108	106
query43	514	533	483	483
query44	1327	829	838	829
query45	183	185	165	165
query46	831	1032	648	648
query47	1828	1901	1764	1764
query48	374	430	322	322
query49	777	554	422	422
query50	715	760	417	417
query51	4294	4294	4244	4244
query52	112	110	107	107
query53	225	255	179	179
query54	494	509	417	417
query55	80	77	78	77
query56	290	273	276	273
query57	1202	1196	1123	1123
query58	284	241	261	241
query59	2714	2958	2839	2839
query60	289	295	259	259
query61	124	121	122	121
query62	854	766	698	698
query63	226	192	189	189
query64	4208	1068	692	692
query65	4399	4305	4333	4305
query66	1072	396	319	319
query67	16625	15699	15503	15503
query68	9666	878	507	507
query69	492	295	259	259
query70	1231	1104	1088	1088
query71	460	301	272	272
query72	5209	4680	4697	4680
query73	694	623	341	341
query74	9076	8943	8693	8693
query75	4297	3200	2717	2717
query76	4424	1195	755	755
query77	973	364	294	294
query78	9888	9986	9277	9277
query79	4819	800	545	545
query80	573	509	443	443
query81	453	258	214	214
query82	361	129	95	95
query83	166	172	167	167
query84	281	94	74	74
query85	749	348	304	304
query86	324	303	291	291
query87	4386	4499	4328	4328
query88	2876	2198	2217	2198
query89	427	307	280	280
query90	2154	206	202	202
query91	136	142	116	116
query92	75	64	53	53
query93	3359	1001	564	564
query94	664	429	275	275
query95	371	275	262	262
query96	475	550	267	267
query97	3117	3187	3124	3124
query98	217	211	205	205
query99	1355	1385	1274	1274
Total cold run time: 285343 ms
Total hot run time: 191834 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 31.4 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit f43c3ff3d5f9902febd0a93a291e83234532724d, data reload: false

query1	0.03	0.04	0.03
query2	0.12	0.11	0.11
query3	0.24	0.19	0.20
query4	1.59	0.19	0.19
query5	0.60	0.59	0.60
query6	1.20	0.73	0.72
query7	0.03	0.01	0.01
query8	0.04	0.04	0.04
query9	0.57	0.51	0.52
query10	0.57	0.59	0.56
query11	0.15	0.11	0.11
query12	0.15	0.11	0.11
query13	0.61	0.60	0.58
query14	2.81	2.70	2.69
query15	0.92	0.86	0.85
query16	0.38	0.38	0.39
query17	1.02	1.03	1.03
query18	0.21	0.20	0.20
query19	1.85	1.95	1.84
query20	0.02	0.01	0.01
query21	15.35	0.88	0.55
query22	0.74	1.15	0.61
query23	15.16	1.39	0.68
query24	6.97	1.22	0.99
query25	0.55	0.24	0.10
query26	0.72	0.15	0.14
query27	0.05	0.05	0.05
query28	8.74	0.88	0.44
query29	12.53	4.07	3.31
query30	0.26	0.09	0.06
query31	2.81	0.58	0.38
query32	3.22	0.55	0.47
query33	3.10	3.02	3.10
query34	15.78	5.10	4.51
query35	4.55	4.54	4.56
query36	0.65	0.49	0.48
query37	0.08	0.06	0.06
query38	0.05	0.04	0.03
query39	0.04	0.02	0.03
query40	0.17	0.14	0.14
query41	0.09	0.03	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 104.8 s
Total hot run time: 31.4 s

@morningman morningman requested a review from Copilot March 31, 2025 09:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces changes to ensure system resources are properly released when a catalog is dropped. Key changes include renaming and refactoring methods (from onRefresh to resetToUninitialized) for catalog reset and closure, and adding onClose implementations in several catalog-related classes to improve resource management.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/AccessControllerManager.java Added blank string check for removal of access controllers
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/JdbcExternalCatalog.java Renamed onRefresh to resetToUninitialized for cleanup consistency
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java Updated close() method now only nullifies the catalog reference
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergExternalCatalog.java Introduced onClose to nullify the catalog reference after calling super
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalCatalog.java Updated resetToUninitialized and added onClose to close executors and ops
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java Refactored resetToUninitialized with added javadoc and onClose enhancements
fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java Updated to call resetToUninitialized instead of onRefresh
fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogIf.java Changed onRefresh call to resetToUninitialized for consistency
Comments suppressed due to low confidence (1)

fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergExternalCatalog.java:104

  • Like in IcebergMetadataOps, simply setting the catalog to null in the onClose() method may not release underlying resources. Consider invoking a dedicated close or cleanup method on the catalog if available.
if (null != catalog) {

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 31, 2025
@github-actions
Copy link
Contributor

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

@CalvinKirs CalvinKirs merged commit 902b95b into apache:master Mar 31, 2025
33 of 35 checks passed
@CalvinKirs CalvinKirs deleted the master-ctl-close branch April 3, 2025 02:32
CalvinKirs added a commit to CalvinKirs/incubator-doris that referenced this pull request Apr 10, 2025
CalvinKirs added a commit to CalvinKirs/incubator-doris that referenced this pull request Apr 10, 2025
yiguolei pushed a commit that referenced this pull request Apr 10, 2025
@yiguolei yiguolei mentioned this pull request May 13, 2025
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…9621)

### Description:
This PR ensures that system resources, such as thread pools, are
properly closed when a catalog is dropped. Previously, these resources
were not explicitly released, which could lead to potential resource
leaks.

### Changes:
Implemented close() method in the catalog to release system resources.

Ensured that thread pools and other managed resources are properly shut
down when dropping a catalog.

Added necessary cleanup logic in the dropCatalog method.
morningman pushed a commit that referenced this pull request Nov 5, 2025
since #49621
Since ExternalCatalog no longer calls methods in the interface when
onClose, we need to manually clean up the values ​​in refreshmanager
when deleting the catalog.
github-actions bot pushed a commit that referenced this pull request Nov 5, 2025
since #49621
Since ExternalCatalog no longer calls methods in the interface when
onClose, we need to manually clean up the values ​​in refreshmanager
when deleting the catalog.
github-actions bot pushed a commit that referenced this pull request Nov 5, 2025
since #49621
Since ExternalCatalog no longer calls methods in the interface when
onClose, we need to manually clean up the values ​​in refreshmanager
when deleting the catalog.
wyxxxcat pushed a commit to wyxxxcat/doris that referenced this pull request Nov 18, 2025
…57680)

since apache#49621
Since ExternalCatalog no longer calls methods in the interface when
onClose, we need to manually clean up the values ​​in refreshmanager
when deleting the catalog.
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/2.1.10-merged dev/3.0.6-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants