Skip to content

Add a chunk_size setting#1318

Merged
mdellweg merged 1 commit intopulp:mainfrom
mdellweg:configure_chunksizes
Feb 18, 2026
Merged

Add a chunk_size setting#1318
mdellweg merged 1 commit intopulp:mainfrom
mdellweg:configure_chunksizes

Conversation

@mdellweg
Copy link
Member

Users experiencing issues when uploading huge files can now define a default chunk size to use per server profile.

@mdellweg mdellweg force-pushed the configure_chunksizes branch 3 times, most recently from 71cb5ce to 4793ecb Compare February 18, 2026 13:14
@mdellweg mdellweg marked this pull request as ready for review February 18, 2026 13:20
@mdellweg mdellweg enabled auto-merge (rebase) February 18, 2026 14:29
repository_ctx: PulpRepositoryContext | None = None,
):
super().__init__(pulp_ctx, pulp_href=pulp_href, entity=entity)
assert (repository_ctx is None) or (repository_ctx.pulp_ctx is pulp_ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

Tell me what the intent is here? I'm missing something

Copy link
Member Author

Choose a reason for hiding this comment

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

This is unrelated. But it's a safeguard that the repository this content context is tied to here belongs to the same server (pulp_ctx).


sha256_hasher = hashlib.sha256()
for chunk in iter(lambda: file.read(chunk_size), b""):
for chunk in iter(lambda: file.read(10_000_000), b""):
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason for 10Mb here? Or is it just "a reasonable amount at a time" to hash?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not any sort of chunk to be used on the network. Here we only hash the file to secure the upload later.
So no reason but that the "other" chunk_size now became unreliable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right - I was just curious if 10Mb was "magic" in some way, or just "a reasonable amount" :)

Comment on lines +747 to +749
if value == "":
# Actually override the default.
return None
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we push these into parse_size()?

Copy link
Member Author

Choose a reason for hiding this comment

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

We commonly "use" "" to represent resetting over None which was "not specified". I don't think we need that in the settings file.

Users experiencing issues when uploading huge files can now define a
default chunk size to use per server profile.

Co-authored-by: Grant Gainey <ggainey@users.noreply.github.com>
@mdellweg mdellweg merged commit 84d1ef1 into pulp:main Feb 18, 2026
32 of 34 checks passed
@mdellweg mdellweg deleted the configure_chunksizes branch February 18, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments