Re: [PATCH v8 00/11] Git filter protocol
- From
Jakub Narębski <jnareb@gmail.com>
- Date
- Sep 29, 2016, 20:59 UTC
- Message-ID
- <f9a6dd02-34c0-d48b-3cbc-73202488920c@gmail.com>
- In-Reply-To
- <f7a4f828-bb1d-0ffa-e369-3b4fa476d9e5@web.de>
W dniu 29.09.2016 o 13:57, Torsten Bögershausen pisze:
> On 29/09/16 12:28, Lars Schneider wrote:
Show 30 quoted lines
>> This is what happens:
>>
>> 1) Git exits
>> 2) The filter process receives EOF and prints "STOP" to the log
>> 3) t0021 checks the content of the log
>>
>> Sometimes 3 happened before 2 which makes the test fail.
>> (Example: https://travis-ci.org/git/git/jobs/162660563 )
>>
>> I added a this to wait until the filter process terminates:
>>
>> +wait_for_filter_termination () {
>> + while ps | grep -v grep | grep -F "/t0021/rot13-filter.pl" >/dev/null 2>&1
>> + do
>> + echo "Waiting for /t0021/rot13-filter.pl to finish..."
>> + sleep 1
>> + done
>> +}
>>
>> Does this look OK to you?
> Do we need the ps at all ?
> How about this:
>
> +wait_for_filter_termination () {
> + while ! grep "STOP" LOGFILENAME >/dev/null
> + do
> + echo "Waiting for /t0021/rot13-filter.pl to finish..."
> + sleep 1
> + done
> +}Or even better: make filter driver write its pid to pidfile, and then "wait $(cat rot13-filter.pid)". That's what we do in lib-git-daemon.sh (I think).
If the problem is exit status of "wait" builtin, then filter driver can remove its pidfile after writing "STOP", just before ending.
-- Jakub Narębski