DEVPROD-18354: Fix log ingestion memory bug#1499
Open
sophstad wants to merge 11 commits intoevergreen-ci:mainfrom
Open
DEVPROD-18354: Fix log ingestion memory bug#1499sophstad wants to merge 11 commits intoevergreen-ci:mainfrom
sophstad wants to merge 11 commits intoevergreen-ci:mainfrom
Conversation
Comment on lines
13
to
14
| const ansiUp = new AnsiUp(); | ||
|
|
There was a problem hiding this comment.
Bug: Moving the stateful AnsiUp instance to a module-level singleton will cause color state to leak between log rows, resulting in incorrect rendering.
Severity: MEDIUM
Suggested Fix
Revert to creating a new AnsiUp instance for each row. To optimize performance, create a per-component instance using useMemo(() => new AnsiUp(), []). This isolates the state to each row while avoiding re-creation on every render.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: apps/parsley/src/components/LogRow/AnsiRow/index.tsx#L13-L14
Potential issue: The `AnsiUp` library is stateful, meaning color settings persist across
calls. By changing its instantiation from per-component to a single module-level
instance, the component now shares state across all log rows. If a log line sets a color
without resetting it at the line's end, a common case in CI logs, that color will
"bleed" into subsequent, unrelated log lines. This will cause visual corruption and
misrepresentation of log data, which is a core function of the application.
Did we get this right? 👍 / 👎 to inform future reviews.
Reject trailing characters after parsed JSON objects so resmoke helper parsing matches prior behavior and ignores malformed suffixes. Made-with: Cursor
khelif96
approved these changes
Apr 16, 2026
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.
DEVPROD-18354
Description
Improve duplicated log data by using a callback from the stream instead of an extra state.
Also update resmoke processing to create new strings with no references to what was ingested, allowing for proper garbage collection.
Note that this fix is not exactly viable in Firefox: Firefox's
TextDecoder.decode()parses intoUTF-16which uses 2x the storage 😩Testing
Validated via memory heap snapshot
Original:

Fix:
