Angular Router auxiliary outlets can exhaust memory during SSR
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 44/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- angular, typescript
- Lĩnh vực
- frontend, performance
Hướng nghiên cứu
Start in the Angular Router recognition flow around processChildren() and mergeEmptyPathMatches(), then reproduce the behavior with the linked router auxiliary-outlet OOM lab. Compare snapshot and query-property allocation for the documented route and request shapes; done means the SSR cases no longer exhaust memory while preserving route recognition.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Which @angular/* package(s) are the source of the bug?
router
Is this a regression?
No
Description
The processChildren() recognizes every outlet before mergeEmptyPathMatches() removes duplicate empty-path branches. Every snapshot created along the way also copies the complete query parameter map:
Object.freeze({ ...this.urlTree.queryParams });
A small route shape is enough:
export const routes: Routes = [
{
path: "shop",
children: [{ path: "", children: [{ path: "", component: ShopPage }] }],
},
{ path: "**", component: NotFound },
];
For example:
/shop/(a:/()//b:/()//...)?a&b&c&...
With 480 outlets and 1,377 distinct query names, the 7,873-byte request creates 1,926 snapshots and copies 2,652,102 query properties.
At 128 MiB:
| Arm | Bytes | Outcome | Snapshots | Keys copied |
|---|---|---|---|---|
| Candidate | 7,873 | 5/5 fatal | 1,926 | 2,652,102 |
| Equal-byte control | 7,873 | 0/5 fatal | 1,926 | 3,852 |
| Query only | 4,084 | 0/5 fatal | 6 | 8,262 |
| Outlets only | 3,794 | 0/5 fatal | 1,926 | 0 |
Neither dimension reaches the same result alone.
I also tested 8 KiB and 16 KiB request lines at different empty-path depths with an async canMatch.
The values below are the lowest concurrency that terminated the worker. For example, 5 means four concurrent requests survived and five reached the OOM boundary.
| Request | Depth | 256 MiB | 512 MiB | 1,024 MiB |
|---|---|---|---|---|
| 8 KiB | 2 | 2 | 5 | 6–16 |
| 3 | 2 | 3 | 6 | |
| 4 | 1 | 3 | 5 | |
| 16 KiB | 2 | 1 | 2 | 4 |
| 3 | 1 | 2 | 3 | |
| 4 | 1 | 1 | 2 |
Without the async guard, concurrency did not help. The largest heaps I could terminate with a single request were:
| Depth | 8 KiB | 16 KiB |
|---|---|---|
| 1 | survives 128 MiB | 256 MiB |
| 2 | 128 MiB | 512 MiB |
| 3 | 128 MiB | 512 MiB |
| 4 | 256 MiB | 1,024 MiB |
Depth is application-controlled, not attacker-controlled.
In this we don't need to use numeric parameters or matrix parameters are involved. Angular 22.2.0 already contains #70717.
Sharing one frozen query map per recognition attempt changed the main 8 KiB / 128 MiB case from 5/5 fatal to 0/5 and reduced the copied properties from 2,652,102 to 1,377.
Please provide a link to a minimal reproduction of the bug
See POC https://github.com/SkyZeroZx/angular-router-aux-outlet-oom-lab
- Ngôn ngữ chính
- TypeScript
- Star
- 101k
- Fork
- 28.1k
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 301
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của angular/angular
-
area: core gemini-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: forms forms: signals
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
angular/angular#70252 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs gemini-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
angular/angular#68808 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: forms forms: signals
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
angular/angular#68296 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của angular/angular
Issue tương tự
-
module-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ports get and web print 'Port N already in use, trying next...' for every busy port they skipĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
appandflow/stim#1604 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
lingdojo/kana-dojo#31060 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SSH workspace restore rewrites relative symlinks into the deleted sync-back staging directoryĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
paperclipai/paperclip#14173 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày