Skip to content
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

Report zonefile parsing & signing progress to the caller. #448

Draft
wants to merge 25 commits into
base: byo-signing-sorter-impl
Choose a base branch
from

Conversation

ximon18
Copy link
Member

@ximon18 ximon18 commented Nov 25, 2024

This allows callers to report progress, which is especially useful on very large zone files.

For example usage see NLnetLabs/dnst#35.

I'm not very happy with the inplace::Zonefile progress support, but due to the replacement of self via the Bytes split() operation, reset of the start variable and the iterator being mutably consumed by the caller, using a new position tracking variable and returning it via Entry seemed like one easy way of getting the progress information out to the iterating caller code.

Perhaps something like Iterator::enumerate() could be used instead to return the progress offset to the iteration loop?

If we keep the extra var returned with Entry it should probably be made into named struct fields instead of anonymous tuple fields, to be more self-evident what the usize value is. Also, the extra tuple field infects all call sites which is annoying as most don't care about it.

Note: This PR lacks progress notification for NSEC hashing, that should also be added.

Thoughts:

  • Progress reporting should be optional, so perhaps the callback should be Option.
  • Progress reporting has a cost, perhaps it should be emitted only every N units instead of for every unit change?

@ximon18 ximon18 requested a review from a team November 25, 2024 13:28
@ximon18 ximon18 changed the title Report zonefile parsing progress to the caller. Report zonefile parsing & signing progress to the caller. Nov 25, 2024
@ximon18 ximon18 force-pushed the report-signing-progress branch from 99e0d40 to 2a8816f Compare December 5, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant