feat(generator): wire --debug=GENR producer emissions (3.4.1 parity)#4110
Merged
Conversation
The audit (G8 in debug-flags-verbosity-matrix.md) flagged GENR as having no producers - the flag table accepted `--debug=GENR` and the bridge mapped `rsync::generator` to it, but no emission site fired. Upstream rsync 3.4.1 emits seven GENR-gated diagnostics from generator.c under DEBUG_GTE(GENR, 1): - recv_generator(%s,%d) (generator.c:1234-1235) - generator starting pid=%d (generator.c:2260-2261) - generate_files phase=%d (generator.c:2355-2357, 2366-2368, 2392-2394) - generate_files finished (generator.c:2436-2437) oc-rsync's receiver-side transfer is the closest analog to upstream's generate_files: it routes every run* entry through setup_transfer (generator starting), drives recv_generator-equivalent quick-check via build_files_to_transfer (per-file recv_generator), and runs the phase ladder in exchange_phase_done / finalize_transfer. This wires debug_log!(Genr, 1, ...) at each of those points. The per-file emission is gated behind debug_gte so the loop is skipped entirely when --debug=GENR is off. The non-inc_recurse phase loop emits once per phase++ (matches upstream lines 2356, 2367, 2393), and the inc_recurse branch emits three times when supports_multi_phase is true (protocol >= 30, which inc_recurse already requires). Five unit tests assert byte-for-byte wording for each upstream message plus a suppression check confirming emissions are gated by debug.genr. The audit doc rolls GENR from missing to impl and marks G8 RESOLVED. Closes #2186.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…4110) * feat(generator): wire --debug=GENR producer emissions (3.4.1 parity) The audit (G8 in debug-flags-verbosity-matrix.md) flagged GENR as having no producers - the flag table accepted `--debug=GENR` and the bridge mapped `rsync::generator` to it, but no emission site fired. Upstream rsync 3.4.1 emits seven GENR-gated diagnostics from generator.c under DEBUG_GTE(GENR, 1): - recv_generator(%s,%d) (generator.c:1234-1235) - generator starting pid=%d (generator.c:2260-2261) - generate_files phase=%d (generator.c:2355-2357, 2366-2368, 2392-2394) - generate_files finished (generator.c:2436-2437) oc-rsync's receiver-side transfer is the closest analog to upstream's generate_files: it routes every run* entry through setup_transfer (generator starting), drives recv_generator-equivalent quick-check via build_files_to_transfer (per-file recv_generator), and runs the phase ladder in exchange_phase_done / finalize_transfer. This wires debug_log!(Genr, 1, ...) at each of those points. The per-file emission is gated behind debug_gte so the loop is skipped entirely when --debug=GENR is off. The non-inc_recurse phase loop emits once per phase++ (matches upstream lines 2356, 2367, 2393), and the inc_recurse branch emits three times when supports_multi_phase is true (protocol >= 30, which inc_recurse already requires). Five unit tests assert byte-for-byte wording for each upstream message plus a suppression check confirming emissions are gated by debug.genr. The audit doc rolls GENR from missing to impl and marks G8 RESOLVED. Closes #2186. * style: cargo fmt
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…4110) * feat(generator): wire --debug=GENR producer emissions (3.4.1 parity) The audit (G8 in debug-flags-verbosity-matrix.md) flagged GENR as having no producers - the flag table accepted `--debug=GENR` and the bridge mapped `rsync::generator` to it, but no emission site fired. Upstream rsync 3.4.1 emits seven GENR-gated diagnostics from generator.c under DEBUG_GTE(GENR, 1): - recv_generator(%s,%d) (generator.c:1234-1235) - generator starting pid=%d (generator.c:2260-2261) - generate_files phase=%d (generator.c:2355-2357, 2366-2368, 2392-2394) - generate_files finished (generator.c:2436-2437) oc-rsync's receiver-side transfer is the closest analog to upstream's generate_files: it routes every run* entry through setup_transfer (generator starting), drives recv_generator-equivalent quick-check via build_files_to_transfer (per-file recv_generator), and runs the phase ladder in exchange_phase_done / finalize_transfer. This wires debug_log!(Genr, 1, ...) at each of those points. The per-file emission is gated behind debug_gte so the loop is skipped entirely when --debug=GENR is off. The non-inc_recurse phase loop emits once per phase++ (matches upstream lines 2356, 2367, 2393), and the inc_recurse branch emits three times when supports_multi_phase is true (protocol >= 30, which inc_recurse already requires). Five unit tests assert byte-for-byte wording for each upstream message plus a suppression check confirming emissions are gated by debug.genr. The audit doc rolls GENR from missing to impl and marks G8 RESOLVED. Closes #2186. * style: cargo fmt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--debug=GENRto emit the seven upstream rsync 3.4.1 diagnostics fromgenerator.c(recv_generator,generator starting pid,generate_files phase,generate_files finished).debug_log!(Genr, 1, ...)at the receiver-side transfer entry (setup_transfer), the per-file recv_generator analog (build_files_to_transfer), and the phase ladder (exchange_phase_done/finalize_transfer).debug_gteso the loop is skipped entirely when the flag is off.phase++, matching upstream lines 2356/2367/2393. The inc_recurse branch emits three times whensupports_multi_phaseis true (protocol >= 30, which inc_recurse already requires).Closes #2186.
Test plan
genr_debug_emission_testsmodule (5 tests)