Repository navigation
Commit 72a7729
authored
[hotfix][Optimizer] Remove zero-valued in-flight task counters (#4328)
[hotfix][Optimizer] Remove per-table in-flight task counters at zero
optimizingTasksMap kept a zero-count AtomicInteger entry forever after
a table's last task completed: poll created entries via
computeIfAbsent, acceptResult decremented but always returned the
holder, and neither releaseTable nor dispose cleaned up. Every table
that ever had a polled task (including deleted tables and tables that
moved groups) permanently occupied one map slot.
Switch acceptResult to an atomic compute that removes the entry at zero
(keeping the >0 decrement guard; late accepts on a removed entry are
no-ops instead of resurrecting it), and clear the entry in
releaseTable/dispose.
Regression test testTasksMapEntryRemovedAfterTaskCompletes (red before:
map size stayed 1). Full TestOptimizingQueue 47/47 green.
Fix record: docs/fix-records/2026-08-16-fix-19-optimizing-tasks-map-leak.md1 parent 7333642 commit 72a7729
2 files changed
Lines changed: 35 additions & 2 deletions
File tree
- amoro-ams/src
- main/java/org/apache/amoro/server/optimizing
- test/java/org/apache/amoro/server/optimizing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
246 | 249 | | |
247 | 250 | | |
248 | 251 | | |
| |||
511 | 514 | | |
512 | 515 | | |
513 | 516 | | |
| 517 | + | |
514 | 518 | | |
515 | 519 | | |
516 | 520 | | |
| |||
697 | 701 | | |
698 | 702 | | |
699 | 703 | | |
700 | | - | |
| 704 | + | |
701 | 705 | | |
702 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
703 | 710 | | |
704 | 711 | | |
705 | 712 | | |
706 | | - | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
707 | 716 | | |
708 | 717 | | |
709 | 718 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
956 | 957 | | |
957 | 958 | | |
958 | 959 | | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
959 | 977 | | |
960 | 978 | | |
961 | 979 | | |
| |||
1065 | 1083 | | |
1066 | 1084 | | |
1067 | 1085 | | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
1068 | 1092 | | |
1069 | 1093 | | |
1070 | 1094 | | |
| |||
0 commit comments