Skip to content

GH-3621: Replace the previous field in the queue instead of appending to the queue#3622

Open
njlaw wants to merge 1 commit into
apache:masterfrom
njlaw:validating-record-consumer-memory-leak
Open

GH-3621: Replace the previous field in the queue instead of appending to the queue#3622
njlaw wants to merge 1 commit into
apache:masterfrom
njlaw:validating-record-consumer-memory-leak

Conversation

@njlaw

@njlaw njlaw commented Jun 19, 2026

Copy link
Copy Markdown

Rationale for this change

The endField method pushes the current field onto the previousField queue, which is used to maintain track of the previous field for each level of nesting with groups; however, the pushed fields are never removed from the queue, so it grows without bound.

What changes are included in this PR?

When endField() is called, it now replaces the previous field for the current nesting depth instead of appending a field.

Are these changes tested?

I added a test that verifies the previousField size is 0 after processing a message; however, the test requires introspection, which feels wrong. I'm open to suggestions!

Are there any user-facing changes?

No, there are no user-facing changes.

Closes #3621

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak in previousField of ValidatingRecordConsumer

1 participant