git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] t9700: ensure cat-file info isn't buffered by default

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Jun 21, 2024, 13:03 UTC
Message-ID
<d5dc3cbd-72ae-4f1a-bd9d-d2608364a08c@gmail.com>
In-Reply-To
<20240619180807.M97115@dcvr>
On 19/06/2024 19:08, Eric Wong wrote:
Show 16 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> wrote:
>> Hi Eric
>>
>> On 17/06/2024 11:43, Eric Wong wrote:
>>> +# ensure --batch-check is unbuffered by default
>>> +my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe(qw(cat-file --batch-check));
>>> +print $out $file1hash, "\n" or die $!;
>>
>> It's been a while since I did any perl scripting and I'm not clear whether
>> $out is buffered or not and if it is whether it is guaranteed to be flushed
>> when we print "\n". It might be worth adding a explicit flush so it is clear
>> that any deadlocks come from cat-file and not our test code.
> 
> Pipes and sockets created by Perl are always unbuffered since
> 5.8, at least.  If they were buffered, Git.pm users (including
> git-svn) wouldn't have worked at all.
Thanks for clarifying that
Show 8 quoted lines
>>> +my $info = <$in>;
>>
>> Is there an easy way to add a timeout to this read so that the failure mode
>> isn't "the test hangs without printing anything"? I'm not sure that failure
>> mode is easy to diagnose from our CI output as it is hard to tell which test
>> caused the CI to timeout and it takes ages for the CI to time out.
> 
> Yeah, select() has been added in v2.
That's much nicer.
Thanks
Phillip
Previous: Eric Wong
Message 16 of 16 in “cat-file related doc and test”
  1. 0/2 cat-file related doc and testEric Wong, Jun 17, 2024
  2. 1/2 Git.pm: use array in command_bidi_pipe exampleEric Wong, Jun 17, 2024
  3. Junio C HamanoJun 17, 2024
  4. 2/2 t9700: ensure cat-file info isn't buffered by defaultEric Wong, Jun 17, 2024
  5. Junio C HamanoJun 17, 2024
  6. 2/2 t1006: ensure cat-file info isn't buffered by defaultEric Wong, Jun 18, 2024
  7. Junio C HamanoJun 18, 2024
  8. Eric WongJun 19, 2024
  9. Junio C HamanoJun 20, 2024
  10. Jeff KingJun 21, 2024
  11. Eric WongJun 21, 2024
  12. Jeff KingJun 24, 2024
  13. Junio C HamanoJun 17, 2024
  14. Phillip WoodJun 19, 2024
  15. Eric WongJun 19, 2024
  16. Phillip WoodJun 21, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.