Repository navigation
fix: concurrent cache misses share one backing request #1711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lucasmcdonald3
wants to merge
40
commits into
master
Choose a base branch
from
lucmcdon/coalesce-cache-misses
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
5d62af5
fix(kms-keyring-node): coalesce concurrent branch key cache misses
32a4efd
fix: coalesce concurrent cache misses in the caching CMM
9fa9480
fix: share branch key copies and skip coalescing uncacheable responses
f77502a
fix(cache-material): coalesce only when an entry can serve two callers
84158b4
docs: clarify cache coalescing comments
38bc0d4
fix: follow the MPL storm-tracking cache for concurrent cache misses
866bb30
docs: clarify storm tracking and batching comments
cefbdf9
refactor: describe concurrent cache misses as sharing one backing req…
e207f7d
m
f3a8760
docs: clarify shared request comments
13ba7fa
m
f5fcf98
docs: place shared request comments next to the code they describe
5ac6d25
docs: trim shared request comments
33d4f28
fix(kms-keyring-node): make grace period opt-in and share fetch errors
c87f3c1
fix(cache-material): forget finished shared requests
1dd154f
fix(cache-material): keep default behavior, add opt-in stormTracking
19cc672
fix(kms-keyring-node): keep default behavior, add opt-in stormTracking
4737df1
docs: tighten shared request and stormTracking comments
de7a792
fix: restore default timings in 3000-caller tests, export stormTracki…
f32dba0
docs: drop the no-new-waits claim from stormTracking docs
0de55e5
refactor: drop the stormTracking option
fb6ea5b
fix: always release waiting callers when a shared request ends
f1e95f5
docs: state the no-added-failures rule once in shared request comments
712eb9a
docs: drop the findBatch comment
2c9d878
docs: rewrite shared request comments one by one
ee71bcf
docs: say what the over-limits check is for
2ec4d0f
docs: rewrite shared request comments for a first-time reader
fc4dad0
test: keep only tests that fail when sharing breaks
22417fb
docs: trim shared_requests comments
bfac44b
fix: share one retry when a shared request fails
8758dbb
docs: rewrite shared request comments
0941412
docs: state the retry rule instead of the flag
c0f1dec
docs: say what releasing waiting callers does on failure
41814da
docs: explain when the batch can exceed its limits
4843825
docs: replace jargon in shared request comments
8eb86f1
docs: drop comment on the shared timing object
61f4442
refactor: share one in-flight request helper
b8547a6
Revert "refactor: share one in-flight request helper"
0e1c53b
Merge branch 'master' into lucmcdon/coalesce-cache-misses
akareddy04 1d84704
Merge branch 'master' into lucmcdon/coalesce-cache-misses
lucasmcdonald3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { CryptographicMaterialsCache } from './cryptographic_materials_cache' | ||
|
|
||
| /* Concurrent cache misses for the same entry share one request to the backing materials manager. | ||
| * If that request fails, its waiting callers share one retry, | ||
| * so a failing backing materials manager gets one more call, not one per waiting caller. | ||
| */ | ||
|
|
||
| export const SHARED_REQUESTS = { | ||
| // A request older than this may be stuck, so new callers don't join it. | ||
| graceInterval: 1000, // milliseconds | ||
| } | ||
|
|
||
| // Requests in progress, by cache and then by cache key. | ||
| // Keyed by cache, so caching materials managers that share a cache also share requests. | ||
| export const batchesByCache = new WeakMap< | ||
| CryptographicMaterialsCache<any>, | ||
| Map<string, any[]> | ||
| >() | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, why chose 1 sec?