{"thread":{"id":"17689","subject":"RFH: spawning pager takes long time when when unconnected from network","startedAt":"2009-02-10T02:07:10Z","lastAt":"2009-02-10T16:34:47Z","messageCount":12,"participants":["Eric Raible","Johannes Sixt","Johannes Schindelin","Jeff King","Andreas Ericsson","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"103943","messageId":"loom.20090210T015515-886@post.gmane.org","threadId":"17689","inReplyTo":null,"subject":"RFH: spawning pager takes long time when when unconnected from network","fromName":"Eric Raible","fromEmail":"raible+git@gmail.com","sentAt":"2009-02-10T02:07:10Z","receivedAt":"2009-02-10T02:07:10Z","isPatch":false,"sender":{"key":"raible+git@gmail.com","avatar":null},"body":"Hello All -\n\nI've got a weird one which I haven't been able to figure out.\nThe problem is that git sometimes takes a long time (~5-10 seconds)\nbefore producing output when it needs to internally spawn a pager.\n\nThis only occurs when I'm not plugged in to a network.\nWhen I'm plugged in everything operates at the normal speed.\n\nThis would be slow: git diff some-branch\nThis would be fast: git diff some-branch | less\n\nUnsetting core.pager (IOW setting core.pager=\"\") is also fast.\n\nTracking this down has been problematic, because I suspect it's\ngot to do with the relative timing of the two processes, and I\ndon't know the code well enough to figure out an effective debugging\nstrategy.\n\nAny ideas or things to try?\n\nThanks - Eric\n"},{"id":"103944","messageId":"loom.20090210T022620-813@post.gmane.org","threadId":"17689","inReplyTo":"loom.20090210T015515-886@post.gmane.org","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Eric Raible","fromEmail":"raible+git@gmail.com","sentAt":"2009-02-10T02:27:57Z","receivedAt":"2009-02-10T02:27:57Z","isPatch":false,"sender":{"key":"raible+git@gmail.com","avatar":null},"body":"Sorry, I meant to send that to gmane.comp.version-control.msysgit,\nsince that's what I'm running (1.6.1.2.549.g547e.dirty).\n\n- Eric\n"},{"id":"103953","messageId":"4991337B.2010102@viscovery.net","threadId":"17689","inReplyTo":"loom.20090210T015515-886@post.gmane.org","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-02-10T07:57:47Z","receivedAt":"2009-02-10T07:57:47Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Eric Raible schrieb:\n> I've got a weird one which I haven't been able to figure out.\n> The problem is that git sometimes takes a long time (~5-10 seconds)\n> before producing output when it needs to internally spawn a pager.\n> \n> This only occurs when I'm not plugged in to a network.\n> When I'm plugged in everything operates at the normal speed.\n> \n> This would be slow: git diff some-branch\n> This would be fast: git diff some-branch | less\n> \n> Unsetting core.pager (IOW setting core.pager=\"\") is also fast.\n\nDo you have a directory in your PATH that points to a disconnected network\ndrive? Do you use the default pager settings, or did you customize the pager?\n\n-- Hannes\n"},{"id":"103958","messageId":"loom.20090210T085859-630@post.gmane.org","threadId":"17689","inReplyTo":"4991337B.2010102@viscovery.net","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Eric Raible","fromEmail":"raible+git@gmail.com","sentAt":"2009-02-10T09:20:18Z","receivedAt":"2009-02-10T09:20:18Z","isPatch":false,"sender":{"key":"raible+git@gmail.com","avatar":null},"body":"Johannes Sixt <j.sixt <at> viscovery.net> writes:\n\n> Do you have a directory in your PATH that points to a disconnected network\n> drive? Do you use the default pager settings, or did you customize the pager?\n\nAll components in my path are local.\n\nEvery time I toggle between core.pager=less and core.ager=less (to disable it)\nit's slow the first time on either setting, then fast on subsequent runs.\n\nIt feels seems like something is trying to read something from the network,\ntiming out, and caching the result.  But as far as I know everything is\nlocal on my machine.\n\nThere are two ways of avoiding the delay: explicitly piping to less\n(so that stdout is not a tty), or setting core.pager=\"\".\n\nThis started happening a few weeks ago (I update my git build often)\nwhen pager wasn't specified.  I suppose I could bisect it, but I'm\nkinda swamped with $dayjob at the moment.\n"},{"id":"103964","messageId":"alpine.DEB.1.00.0902101124160.10279@pacific.mpi-cbg.de","threadId":"17689","inReplyTo":"loom.20090210T085859-630@post.gmane.org","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-10T10:24:35Z","receivedAt":"2009-02-10T10:24:35Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 10 Feb 2009, Eric Raible wrote:\n\n> Johannes Sixt <j.sixt <at> viscovery.net> writes:\n> \n> > Do you have a directory in your PATH that points to a disconnected network\n> > drive? Do you use the default pager settings, or did you customize the pager?\n> \n> All components in my path are local.\n\nCould you run it with GIT_TRACE=<file>?\n\nCiao,\nDscho\n"},{"id":"103967","messageId":"279b37b20902100253v3cfd8e45kefa6da7de2ea4a4b@mail.gmail.com","threadId":"17689","inReplyTo":"alpine.DEB.1.00.0902101124160.10279@pacific.mpi-cbg.de","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Eric Raible","fromEmail":"raible@gmail.com","sentAt":"2009-02-10T10:53:31Z","receivedAt":"2009-02-10T10:53:31Z","isPatch":false,"sender":{"key":"raible@gmail.com","avatar":null},"body":"On Tue, Feb 10, 2009 at 2:24 AM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Tue, 10 Feb 2009, Eric Raible wrote:\n>\n>> Johannes Sixt <j.sixt <at> viscovery.net> writes:\n>>\n>> > Do you have a directory in your PATH that points to a disconnected network\n>> > drive? Do you use the default pager settings, or did you customize the pager?\n>>\n>> All components in my path are local.\n>\n> Could you run it with GIT_TRACE=<file>?\n>\n> Ciao,\n> Dscho\n>\n\nThe first thing I tried was to set GIT_TRACE=1, and it doesn't give much:\ntrace: built-in: git 'diff' 'ss' '--name-only'\ntrace: run_command: 'sh' '-c' 'less'\n\nThe long pause in question begins after the above output is produced\nbut before the list of files is shown.  The output is identical when setting\nGIT_TRACE to a file.\n\nWhen I pipe the git diff to less or set core.pager=\"\",\nthen obviously it doesn't call run_command.\n\nSince I can't really reproduce this in the debugger\n(because the \"bug\" is an intermittent delay of 3-10 seconds), I tried\nlittering the code with trace_printf's.  Didn't really help, partially because\nafter the dup2 (which is part of spawning the pager process)\nthey don't on stdout any longer.  Now that I know about setting\nGIT_TRACE to a file perhaps this is worth trying again.\n\nBut once it started to look like the delay was in the xdiff machinery,\nI figured I was chasing a side-effect, and that the real problem was\nsome interaction between the two processes.  That's when I sent\nmy first RFH  to the list.\n\n- Eric\n"},{"id":"103969","messageId":"alpine.DEB.1.00.0902101159300.10279@pacific.mpi-cbg.de","threadId":"17689","inReplyTo":"279b37b20902100253v3cfd8e45kefa6da7de2ea4a4b@mail.gmail.com","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-10T11:03:35Z","receivedAt":"2009-02-10T11:03:35Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 10 Feb 2009, Eric Raible wrote:\n\n> On Tue, Feb 10, 2009 at 2:24 AM, Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n>\n> > On Tue, 10 Feb 2009, Eric Raible wrote:\n> >\n> >> Johannes Sixt <j.sixt <at> viscovery.net> writes:\n> >>\n> >> > Do you have a directory in your PATH that points to a disconnected network\n> >> > drive? Do you use the default pager settings, or did you customize the pager?\n> >>\n> >> All components in my path are local.\n> >\n> > Could you run it with GIT_TRACE=<file>?\n> \n> The first thing I tried was to set GIT_TRACE=1, and it doesn't give much:\n> trace: built-in: git 'diff' 'ss' '--name-only'\n> trace: run_command: 'sh' '-c' 'less'\n> \n> The long pause in question begins after the above output is produced\n> but before the list of files is shown.  The output is identical when setting\n> GIT_TRACE to a file.\n> \n> When I pipe the git diff to less or set core.pager=\"\",\n> then obviously it doesn't call run_command.\n\nYou could also try to set it to /bin/false, just so you know if the delay \nis caused by the shell startup.\n\n> Since I can't really reproduce this in the debugger (because the \"bug\" \n> is an intermittent delay of 3-10 seconds), I tried littering the code \n> with trace_printf's.  Didn't really help, partially because after the \n> dup2 (which is part of spawning the pager process) they don't on stdout \n> any longer.  Now that I know about setting GIT_TRACE to a file perhaps \n> this is worth trying again.\n> \n> But once it started to look like the delay was in the xdiff machinery,\n> I figured I was chasing a side-effect, and that the real problem was\n> some interaction between the two processes.  That's when I sent\n> my first RFH  to the list.\n\nIn my experience, such intermittent delays are often triggered by some \n(mostly unnecessary) calls to either DNS (which might hang for quite some \ntime) or domain controllers (same).  These can be triggered by shell \nstartup looking for the user or host name.\n\nHowever, I am just fishing here, as I cannot begin to get an idea what is \nhappening on your side.\n\nAlso, it does not help that the platform is Windows, an OS I am mostly \nunfamiliar with.  But there have to be profiling tools for that platform \nwhere you should be able to see what function is blocking (I assume it is \na blocking call, of course).\n\nCiao,\nDscho\n"},{"id":"103973","messageId":"20090210110729.GC12089@coredump.intra.peff.net","threadId":"17689","inReplyTo":"279b37b20902100253v3cfd8e45kefa6da7de2ea4a4b@mail.gmail.com","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-02-10T11:07:29Z","receivedAt":"2009-02-10T11:07:29Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 10, 2009 at 02:53:31AM -0800, Eric Raible wrote:\n\n> The first thing I tried was to set GIT_TRACE=1, and it doesn't give much:\n> trace: built-in: git 'diff' 'ss' '--name-only'\n> trace: run_command: 'sh' '-c' 'less'\n> \n> The long pause in question begins after the above output is produced\n> but before the list of files is shown.  The output is identical when setting\n> GIT_TRACE to a file.\n\nDoes your shell run a .profile or similar, and if so, is there anything\nin it that might touch the network?\n\n-Peff\n"},{"id":"103974","messageId":"49916058.3070800@op5.se","threadId":"17689","inReplyTo":"279b37b20902100253v3cfd8e45kefa6da7de2ea4a4b@mail.gmail.com","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2009-02-10T11:09:12Z","receivedAt":"2009-02-10T11:09:12Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Eric Raible wrote:\n> On Tue, Feb 10, 2009 at 2:24 AM, Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n>> Hi,\n>>\n>> On Tue, 10 Feb 2009, Eric Raible wrote:\n>>\n>>> Johannes Sixt <j.sixt <at> viscovery.net> writes:\n>>>\n>>>> Do you have a directory in your PATH that points to a disconnected network\n>>>> drive? Do you use the default pager settings, or did you customize the pager?\n>>> All components in my path are local.\n>> Could you run it with GIT_TRACE=<file>?\n>>\n>> Ciao,\n>> Dscho\n>>\n> \n> The first thing I tried was to set GIT_TRACE=1, and it doesn't give much:\n> trace: built-in: git 'diff' 'ss' '--name-only'\n> trace: run_command: 'sh' '-c' 'less'\n> \n> The long pause in question begins after the above output is produced\n> but before the list of files is shown.  The output is identical when setting\n> GIT_TRACE to a file.\n> \n\nMight be a stupid question, but do you have anything network mounted\nanywhere in your $PATH?\n\nDo you get the same delay with an absolute path to less in core.pager?\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"103980","messageId":"279b37b20902100339w6e4d215cua41887c65f7c37bc@mail.gmail.com","threadId":"17689","inReplyTo":"alpine.DEB.1.00.0902101159300.10279@pacific.mpi-cbg.de","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Eric Raible","fromEmail":"raible@gmail.com","sentAt":"2009-02-10T11:39:11Z","receivedAt":"2009-02-10T11:39:11Z","isPatch":false,"sender":{"key":"raible@gmail.com","avatar":null},"body":"On Tue, Feb 10, 2009 at 3:03 AM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> You could also try to set it to /bin/false, just so you know if the delay\n> is caused by the shell startup.\n>\n> In my experience, such intermittent delays are often triggered by some\n> (mostly unnecessary) calls to either DNS (which might hang for quite some\n> time) or domain controllers (same).  These can be triggered by shell\n> startup looking for the user or host name.\n>\n> However, I am just fishing here, as I cannot begin to get an idea what is\n> happening on your side.\n>\n> Also, it does not help that the platform is Windows, an OS I am mostly\n> unfamiliar with.  But there have to be profiling tools for that platform\n> where you should be able to see what function is blocking (I assume it is\n> a blocking call, of course).\n>\n> Ciao,\n> Dscho\n\nToggling core.pager btwn /bin/false and less is slow the first time,\nthen quick subsequent times.  Setting core.pager to \"echo no pager\"\ngives the same behavior.\n\nWhat would be handy is a windows version of strace, but the one\nthat I found doesn't seem functional.  gdb is useless for this\n(so far, anyway).    I think it's time to sleep on this.\n\nThanks - Eric\n"},{"id":"103985","messageId":"279b37b20902100355r44985270x50ff8cb8a072868d@mail.gmail.com","threadId":"17689","inReplyTo":"20090210110729.GC12089@coredump.intra.peff.net","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Eric Raible","fromEmail":"raible@gmail.com","sentAt":"2009-02-10T11:55:48Z","receivedAt":"2009-02-10T11:55:48Z","isPatch":false,"sender":{"key":"raible@gmail.com","avatar":null},"body":"On Tue, Feb 10, 2009 at 3:07 AM, Jeff King <peff@peff.net> wrote:\n>> The long pause in question begins after the above output is produced\n>> but before the list of files is shown.  The output is identical when setting\n>> GIT_TRACE to a file.\n>\n> Does your shell run a .profile or similar, and if so, is there anything\n> in it that might touch the network?\n>\n> -Peff\n>\n\nMy shell is the standard vanilla msysgit shell, with no customizations.\nIt does of course seem that something is touching the network, but I\nhave no idea what that might be.  Nothing in my path, that's for sure.\n\n- Eric\n"},{"id":"104035","messageId":"76718490902100834j7f1f61aaibdefe8416091b3fb@mail.gmail.com","threadId":"17689","inReplyTo":"279b37b20902100355r44985270x50ff8cb8a072868d@mail.gmail.com","subject":"Re: RFH: spawning pager takes long time when when unconnected from network","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-02-10T16:34:47Z","receivedAt":"2009-02-10T16:34:47Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Tue, Feb 10, 2009 at 6:55 AM, Eric Raible <raible@gmail.com> wrote:\n> My shell is the standard vanilla msysgit shell, with no customizations.\n> It does of course seem that something is touching the network, but I\n> have no idea what that might be.  Nothing in my path, that's for sure.\n\nIf you plug into the network, but statically assign yourself a bogus\nIP so that you don't get anywhere, does the same thing happen? If so,\nthen perhaps you can sniff your network interface to see what the\ntraffic is.\n\nj.\n"}]}