Hierarchical Keyring: cold-cache stampede — N concurrent decrypts → N DynamoDB/KMS calls
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
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- aws, node.js, typescript
Hướng nghiên cứu
Bắt đầu từ đường dẫn getBranchKeyMaterials của Node Hierarchical Keyring và theo dõi cách materials cache xử lý một lần tra cứu khi cache lạnh. Tái hiện sự cố bằng các thao tác giải mã hoặc mã hóa đồng thời cho một phiên bản branch-key, đồng thời xác minh rằng một yêu cầu keystore đang thực hiện được dùng chung, các mục đã hoàn tất được xóa và một yêu cầu thất bại có thể được thử lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Security issue notifications
If you discover a potential security issue in the AWS Encryption SDK we ask that you notify AWS Security via our vulnerability reporting page. Please do not create a public GitHub issue.
Problem:
The Node Hierarchical Keyring doesn't de-dupe concurrent branch-key lookups. If I fire a lot of decrypts for the same branch key at once against a cold cache, they all miss the cache together (it's only filled after the keystore call returns), so each one hits the keystore on its own.
So instead of one lookup I get N DynamoDB GetItem + N KMS Decrypt calls. Easy to repro: await Promise.all of ~3000 decrypts for the same key version, and you see ~3000 keystore calls instead of 1. Encrypt has the same problem since it shares the same code path.
Solution:
Add single-flight to getBranchKeyMaterials: on a miss, the first caller starts the keystore fetch and stores the in-flight promise (keyed by cache entry id); everyone else for the same key awaits that promise instead of starting their own. The entry is dropped once it settles, so the materials cache still owns caching and TTL, and a failed request isn't shared — the next call just retries.
Out of scope:
The legacy caching CMM has the same gap but it's a separate path, so I'm not touching it here.
- Ngôn ngữ chính
- TypeScript
- Star
- 260
- Fork
- 68
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
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 aws/aws-encryption-sdk-javascript
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
aws/aws-encryption-sdk-javascript#1656 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
aws/aws-encryption-sdk-javascript#1691 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
aws/aws-encryption-sdk-javascript#1665 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aws/aws-encryption-sdk-javascript#1520 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
aws/aws-encryption-sdk-javascript#1192 · 3 bình luận ·
Tất cả issue của aws/aws-encryption-sdk-javascript
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Client support matrix inclusion Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
calcite-components needs triage refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Esri/calcite-design-system#15203 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
danielmiessler/LifeOS#2218 ·