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

Re: [BUG] Halt during fetch on MacOS

From
Kyle J. McKay <mackyle@gmail.com>
Date
Mar 2, 2014, 02:02 UTC
Message-ID
<F9B4418D-9414-4857-9199-EDBA20B952C6@gmail.com>
In-Reply-To
<20140301061532.GC20397@sigill.intra.peff.net>
On Feb 28, 2014, at 22:15, Jeff King wrote:
Show 19 quoted lines
> On Fri, Feb 28, 2014 at 03:26:28PM -0800, Conley Owens wrote:
>
>> test.sh
>> """""""""""""""""""""""""""""""""""""
>> #!/bin/bash
>> rungit() {
>>    mkdir $1
>>    GIT_DIR=$1 git init --bare
>>    echo '[remote "aosp"]' > $1/config
>>    echo '    url =
>> https://android.googlesource.com/platform/external/tinyxml2' >>
>> $1/config
>>    GIT_DIR=$1 git fetch aosp +refs/heads/master:refs/remotes/aosp/ 
>> master
>
> I don't think this is affecting your test, but you probably want  
> ">>" to
> append to the config for the first line, too. Otherwise you are
> overwriting some of git's default settings.
I replaced it with a call to git config in my version.
Show 12 quoted lines
>> When everything cools, you can see that there are some fetches  
>> hanging
>> (typically).
>> $ ps | grep 'git fetch'
>> ...
>> 63310 ttys004    0:00.01 git fetch aosp
>> +refs/heads/master:refs/remotes/aosp/master
>> [...]
>
> I can't reproduce here on Linux. Can you find out what the processes  
> are
> doing with something like strace?
I can't reproduce, mostly, on Mac OS X 10.5.8 or 10.6.8.

What I mean by mostly is that the very first time I ran the test script I got approximately 36 of these errors:

fatal: unable to access 'https://android.googlesource.com/platform/external/tinyxml2/' : Unknown SSL protocol error in connection to android.googlesource.com: 443

The rest of the fetches completed.  That was with Git 1.8.5.1.

However, I was never able to reproduce those errors again. All the subsequent runs completed all fetches successfully using that same Git version so I also tried Git 1.8.5.2, 1.8.5.5 and Git 1.7.6.1 on the original and another machine.

I am, however NAT'd, so it's possible the NAT was somehow responsible for the initial 36 failures.

Perhaps you are seeing a similar issue.
You might try setting these sysctl variables:

# Timeout new TCP connections after 30 seconds instead of 75 net.inet.tcp.keepinit=30000 # Always keep alive TCP connections net.inet.tcp.always_keepalive=1 # Start keep alive checks after 30 seconds instead of 2 hours net.inet.tcp.keepidle=30000 # Wait 5 seconds between probes instead of 75 # Note that 8 probes in a row must fail to drop the connection net.inet.tcp.keepintvl=5000

then running your test again and see if the hanging git fetch processes die with some kind of failed connection error within about 70 seconds or so. With the default sysctl settings, even with Git enabling keep alives, it would likely take a bit over two hours for a dead connection to be noticed.

--Kyle
Previous: Jeff KingNext: Jacopo Notarstefano
Message 3 of 11 in “[BUG] Halt during fetch on MacOS”
  1. Conley OwensFeb 28, 2014
  2. Jeff KingMar 1, 2014
  3. Kyle J. McKayMar 2, 2014
  4. Jacopo NotarstefanoMar 4, 2014
  5. Conley OwensMar 4, 2014
  6. Max HornMar 2, 2014
  7. Conley OwensMar 3, 2014
  8. Conley OwensMar 5, 2014
  9. Junio C HamanoMar 6, 2014
  10. Jeff KingMar 6, 2014
  11. Conley OwensMar 6, 2014

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.