Re: [PATCH v2 1/3] sideband: avoid reporting incomplete sideband messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Junio,

On Tue, 20 Oct 2020, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@xxxxxxxxx>
> writes:
>
> > From: Johannes Schindelin <johannes.schindelin@xxxxxx>
> >
> > In 2b695ecd74d (t5500: count objects through stderr, not trace,
> > 2020-05-06) we tried to ensure that the "Total 3" message could be
> > grepped in Git's output, even if it sometimes got chopped up into
> > multiple lines in the trace machinery.
> > ...
> > The correct way to fix this is to return from `demultiplex_sideband()`
> > early. The caller will then write out the contents of the primary packet
> > and continue looping. The `scratch` buffer for incomplete sideband
> > messages is owned by that caller, and will continue to accumulate the
> > remainder(s) of those messages. The loop will only end once
> > `demultiplex_sideband()` returned non-zero _and_ did not indicate a
> > primary packet, which is the case only when we hit the `cleanup:` path,
> > in which we take care of flushing any unfinished sideband messages and
> > release the `scratch` buffer.
> >
> > To ensure that this does not get broken again, we introduce a pair of
> > subcommands of the `pkt-line` test helper that specifically chop up the
> > sideband message and squeeze a primary packet into the middle.
> >
> > Final note: The other test case touched by 2b695ecd74d (t5500: count
> > objects through stderr, not trace, 2020-05-06) is not affected by this
> > issue because the sideband machinery is not involved there.
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
> > ---
>
> Nicely explained.  Do we want to also give credit to Peff for the
> single-liner fix here, perhaps with a suggested/helped-by trailer?

Sure.

I had not added that because I had actually come up with the fix
independently in my analysis before I read Peff's reply thoroughly.

But credit where credit is due: without Peff's reply, I would not have
worked on the full fix and stayed with the work-around.

Ciao,
Dscho




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux