Re: [PATCHv3 02/11] run-command: report failure for degraded output just once
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Nov 4, 2015, 20:36 UTC
- Message-ID
- <563A6C3D.2050805@kdbg.org>
- In-Reply-To
- <CAGZ79kaiRKHd2RS9eNeZt_VZqqBF0HS0D=x1HbOTPXYOphu8pg@mail.gmail.com>
Am 04.11.2015 um 21:14 schrieb Stefan Beller:
Show 14 quoted lines
> On Wed, Nov 4, 2015 at 10:14 AM, Junio C Hamano <gitster@pobox.com> wrote: >> Imagine that we are running two things A and B at the same time. We >> ask poll(2) and it says both A and B have some data ready to be >> read, and we try to read from A. strbuf_read_once() would try to >> read up to 8K, relying on the fact that you earlier set the IO to be >> nonblock. It will get stuck reading from A without allowing output >> from B to drain. B's write may get stuck because we are not reading >> from it, and would cause B to stop making progress. >> >> What if the other sides of the connection from A and B are talking >> with each other, > > I am not sure if we want to allow this ever. How would that work with > jobs==1? How do we guarantee to have A and B running at the same time?
I think that a scenario where A and B are communicating is rather far-fetched. We are talking about parallelizing independent tasks. I would not worry.
-- Hannes