Skip to content

release-26.1: log: fix infinite loop bug from malformed log json decoding#163353

Merged
kyle-a-wong merged 1 commit intocockroachdb:release-26.1from
kyle-a-wong:blathers/backport-release-26.1-163224
Feb 13, 2026
Merged

release-26.1: log: fix infinite loop bug from malformed log json decoding#163353
kyle-a-wong merged 1 commit intocockroachdb:release-26.1from
kyle-a-wong:blathers/backport-release-26.1-163224

Conversation

@kyle-a-wong
Copy link
Contributor

@kyle-a-wong kyle-a-wong commented Feb 11, 2026

Backport 1/1 commits from #163224 on behalf of @kyle-a-wong.


When the statusServer.LogFile() API encounters malformed json in json
formatted logs, it results in an infinite loop that eventually crashes
a node dude to it going OOM. To fix this, the API will now stop reading
from the log file and return all previously parsed logs. This means that
properly formatted logs after a malformed line will not be returned.

Epic: None
Release note (bug fix): Fixes a bug where generating a debug zip causes
a node to OOM. This OOM happens when a log file contains a malformed
log and is using json (or json-compact) formatting.


Release justification: Fixes a bug that can cause an infinite loop and eventual OOM. The change only low impact and only affects the code path that causes the OOM.

When the statusServer.LogFile() API encounters malformed json in json
formatted logs, it results in an infinite loop that eventually crashes
a node dude to it going OOM. To fix this, the API will now stop reading
from the log file and return all previously parsed logs. This means that
properly formatted logs after a malformed line will not be returned.

Note: This bug was introduced in 24.1 via cockroachdb#113722, which added logic to
handle malformed logs. This bugfix essentially reverts back to the
previous versions logic when handling json formatted logs.

Epic: None
Release note (bug fix): Fixes a bug where generating a debug zip causes
a node to OOM. This OOM happens when a log file contains a malformed
log and is using json (or json-compact) formatting.
@kyle-a-wong kyle-a-wong requested review from a team as code owners February 11, 2026 17:24
@kyle-a-wong kyle-a-wong requested review from jasonlmfong and removed request for a team February 11, 2026 17:24
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Feb 11, 2026
@kyle-a-wong kyle-a-wong requested review from arjunmahishi and removed request for a team February 11, 2026 17:24
@blathers-crl
Copy link

blathers-crl bot commented Feb 11, 2026

Thanks for opening a backport.

Before merging, please confirm that the change does not break backwards compatibility and otherwise complies with the backport policy. Include a brief release justification in the PR description explaining why the backport is appropriate. All backports must be reviewed by the TL for the owning area. While the stricter LTS policy does not yet apply, please exercise judgment and consider gating non-critical changes behind a disabled-by-default feature flag when appropriate.

@blathers-crl blathers-crl bot added backport Label PR's that are backports to older release branches T-observability labels Feb 11, 2026
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@dhartunian dhartunian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release justification: this behavior is not gated or opt-in because it's an improvement to error handling. Adding configuration to it would complicate the implementation further and make it harder to verify. This change adds a new code branch that is only triggered in the case of a malformed JSON decode and exits early.

@kyle-a-wong kyle-a-wong merged commit dcd0688 into cockroachdb:release-26.1 Feb 13, 2026
17 checks passed
@rail
Copy link
Member

rail commented Feb 17, 2026

blathers backport release-26.1.0-rc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Label PR's that are backports to older release branches blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. T-observability v26.1.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants