Skip to content

KAFKA-17265 Fix flaky MemoryRecordsBuilderTest#testBuffersDereferencedOnClose #17092

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

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

brandboat
Copy link
Member

related to https://issues.apache.org/jira/browse/KAFKA-17265

The test depends on GC to verify the memory usage. However, that is unstable. All we want to prove is that the inner "object" will drop the reference. Hence, we should rewrite the test to check the reference of inner object instead of calling GC.

This PR mainly turn MemoryRecordsBuilderTest#testBuffersDereferencedOnClose into an unit test to make sure after MemoryRecordsBuilder#build is invoked, data stream is closed and we can't append any record to MemoryRecordsBuilder.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

Copy link
Collaborator

@TaiJuWu TaiJuWu left a comment

Choose a reason for hiding this comment

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

Interesting fix. LGTM.

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

LGTM

@chia7712 chia7712 merged commit 190df07 into apache:trunk Sep 5, 2024
5 of 6 checks passed
@brandboat brandboat deleted the KAFKA-17265 branch September 5, 2024 11:48
tedyu pushed a commit to tedyu/kafka that referenced this pull request Jan 6, 2025
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.

3 participants