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

RE: [EXT] Re: ls-remote bug

From
LZLior Zeltzer <liorz@marvell.com>
Date
Oct 27, 2023, 11:16 UTC
Message-ID
<BL0PR18MB213007901229C84D348D4CB8BADCA@BL0PR18MB2130.namprd18.prod.outlook.com>
In-Reply-To
<ZTsNfgJV1JN2y-Aw@debian.me>

The reproduction ,as I wrote in the code, should be done with few threads in parallel Each working on a list of ~10 repos with each repo containing a lot of refs/tags (~1000) All this should be against gerrit (my gerrit is 3.8.0)

Also read the notes below regarding the code that was moved between 2.31.8 and 2.32.0 in ls-remote.c file I can elaborate more, in a zoom meeting.

10x Lior.

-----Original Message-----
From: Bagas Sanjaya <bagasdotme@gmail.com> 
Sent: Friday, October 27, 2023 4:08 AM
To: Lior Zeltzer <liorz@marvell.com>; Git Mailing List <git@vger.kernel.org>
Cc: Andrzej Hunt <ajrhunt@google.com>; Ævar Arnfjörð Bjarmason <avarab@gmail.com>; Junio C Hamano <gitster@pobox.com>
Subject: [EXT] Re: ls-remote bug
External Email

---------------------------------------------------------------------- On Tue, Oct 24, 2023 at 10:55:24AM +0000, Lior Zeltzer wrote:

Show 18 quoted lines
> 
> >uname -a
> Linux dc3lp-veld0045 3.10.0-1160.21.1.el7.x86_64 #1 SMP Tue Mar 16 
> 18:28:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
> 
> Gerrit version :
> 3.8.0
> 
> Bug description : 
> When running ls-remote : sometime data gets cut in the middle
> 
> Reproducing :
> You need a few files with a few repo names (I used 4 files with 10 
> repos each) Call then l1..l4 And the code below just cd into each of 
> them does ls-remote twice and compares the data Doing it in parallel 
> on all lists.
> Data received in both ls-remotes should be the same , if not, it 
> prints *** Repos should contain a lot of tags and refs
What repo did you find this regression? Did you mean linux.git (Linux kernel)?
Show 48 quoted lines
> 
> Note : 
> 1.  without stderr redirection (2>&1) all works well 2. On local repos 
> (not through gerrit) all works well
> 
> I compared various git vers and found the bug to be between 2.31.8 and 
> 2.32.0 Comparing ls-remote.c file between those vers gave me :
> 
> Lines :
> if (transport_disconnect(transport))
> 		return 1;
> 
> moved to end of sub
> 
> copying ls-remote.c from 2.31.8 to 2.32.0 - fixed the bug
> 
> 
> 
> Code reproducing bug :
> 
> #!/proj/mislcad/areas/DAtools/tools/perl/5.10.1/bin/perl -w use 
> strict; use Cwd qw(cwd);
> 
> my $count = 4;
> for my $f (1..$count) {
>   my $child = fork();
>   if (!$child) {
>     my $curr = cwd();
>     
>     my @repos = `cat l$f`;
>     foreach my $repo (@repos) {
>       chomp $repo;
>       print "$repo\n";
>       chdir($repo);
>       my $remote_tags_str = `git ls-remote  2>&1`;
>       my $remote_tags_str2 = `git ls-remote  2>&1 `;
>       chdir($curr);
>       if ( $remote_tags_str ne $remote_tags_str2) {
>          print "***\n";
>       }
>     }
>   
>     exit(0);
>   }
> }
> while (wait != -1) {}
> 1;
> 
I tried reproducing this regression by:

``` $ cd /path/to/git.git $ git ls-remote 2>&1 > /tmp/root.list $ cd builtin/ $ git ls-remote 2>&1 > /tmp/builtin.list $ cd ../ $ git diff --no-index /tmp/root.list /tmp/builtin.list ```

And indeed, the diff was empty (which meant that both listings are same).
Confused...

-- An old man doll... just what I always wanted! - Clara

Previous: Bagas SanjayaNext: René Scharfe
Message 3 of 6 in “ls-remote bug”
  1. Lior ZeltzerOct 24, 2023
  2. Bagas SanjayaOct 27, 2023
  3. Lior ZeltzerOct 27, 2023
  4. René ScharfeOct 29, 2023
  5. Lior ZeltzerOct 30, 2023
  6. René ScharfeOct 31, 2023

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.