Re: [PATCH 3/3] Add sideband status report to git-archive protocol

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

 



Franck Bui-Huu <vagabon.xyz@xxxxxxxxx> writes:

>> I was uncomfortable letting waitpid() there to wait forever.
>> When does poll() return?  (1) we have data ready in which case
>> we process; (2) the child somehow closed the pipe but without
>> dying, which is an error in the child.  In the latter case even
>> not hanging in waitpid() and retrying the poll would not give
>> any useful input so that would not help either.
>
> your case (2) is not totaly right. If you look a the trace above,
> for the normal case, you can see that the child close the pipe then 
> _after_ a while die. So there's a time when the child is not died
> but the pipe is closed.
>
> I think it's safe to assume that if the child closes the pipe, either
> because it has finished to write or something wrong going on, then
> it's going to die pretty soon. 

I am essentially saying the same thing (and perhaps one more).
Something is wrong with the child, and either it's going to die
pretty soon in which case waitpid() to wait forever is fine, or
even if it is not going to die soon, going back to poll() would
not give us any useful information anyway, so WNOHANG was
pointless.

So we are in agreement.

> I think calling send_sideband() with sz = 0 should be fine,

I just coded it defensively -- no point calling send() when you
already know there is nothing to be sent.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]