Skip to content

Add buffer validation and tests for passthrough concurrent file merging #2012

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
Mar 14, 2025

Conversation

wswsmao
Copy link
Contributor

@wswsmao wswsmao commented Mar 12, 2025

This PR addresses the outstanding issue discussed in this comment. The following changes are introduced:

  1. New checkHoles method
    During the processBatchChunks, we now record the starting position and the actual size of the buffer read each time. This information is then validated by the checkHoles method to ensure there are no gaps or overwrites in the buffer.
  2. Validation after w.Write(buffer)
    We also added validation for the return value after w.Write(buffer) to prevent any unknown write errors.
  3. Supplementary test cases
    Additional test cases have been included to cover three scenarios: normal batch processing with validation, batch processing with unhandled chunks, and errors in index calculations.

Copy link
Member

@ktock ktock left a comment

Choose a reason for hiding this comment

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

Thanks

@ktock ktock merged commit a00b4ba into containerd:main Mar 14, 2025
31 checks passed
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.

2 participants