Repository navigation
replacer: cache file lookups and cap them - #8248
Merged
Merged
Conversation
Signed-off-by: Mohammed Al Sahaf <[email protected]>
steadytao
requested changes
Oct 19, 2026
kimjooyoon
reviewed
Oct 21, 2026
kimjooyoon
left a comment
There was a problem hiding this comment.
Codex agent review. One reproduced cache-recognition regression is attached inline; no overall approval or full-suite claim.
Memoize file placeholder results per replacement call, using an 8 MiB LRU for contents. Preserve empty and failed-read results without changing the output for unknown placeholders. Signed-off-by: Mohammed Al Sahaf <[email protected]>
steadytao
requested changes
Oct 24, 2026
steadytao
approved these changes
Oct 24, 2026
mohammed90
enabled auto-merge (squash)
October 24, 2026 22:10
This was referenced Nov 3, 2026
NickCao
pushed a commit
to NickCao/caddy
that referenced
this pull request
Nov 4, 2026
* replacer: cache file lookups and cap them Signed-off-by: Mohammed Al Sahaf <[email protected]> * replacer: cache repeated file placeholder lookups Memoize file placeholder results per replacement call, using an 8 MiB LRU for contents. Preserve empty and failed-read results without changing the output for unknown placeholders. Signed-off-by: Mohammed Al Sahaf <[email protected]> --------- Signed-off-by: Mohammed Al Sahaf <[email protected]> (cherry picked from commit 4e8de21)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
OSS-Fuzz reports timeout (> 60 seconds) on large number of
{file.replacements. The culprit in oss-fuzz sample is repetitive replacements of the same referenced file. Now the replacement of unique file is cached. Moreover, a reasonable cap of 1000 is introduced to avoid recurrence with huge number of unique files.Fixes #8247
Assistance Disclosure
(Copilot/Sonnet 5) generated the code, and I verified it is correct.