{"thread":{"id":"35295","subject":"Request: timeout option for remote operations, esp. \"git fetch\"","startedAt":"2013-11-07T17:07:40Z","lastAt":"2013-11-14T08:01:22Z","messageCount":6,"participants":["H. Peter Anvin","Eric Wong","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"230201","messageId":"527BC8DC.7010108@zytor.com","threadId":"35295","inReplyTo":null,"subject":"Request: timeout option for remote operations, esp. \"git fetch\"","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2013-11-07T17:07:40Z","receivedAt":"2013-11-07T17:07:40Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"When a remote server is unavailable or very slow, some git commands can\nstall out indefinitely.  It would be a very good thing if remote\ncommands -- but especially git fetch -- could be given a timeout.\n\n\t-hpa\n"},{"id":"230373","messageId":"20131110201751.GA18513@dcvr.yhbt.net","threadId":"35295","inReplyTo":"527BC8DC.7010108@zytor.com","subject":"Re: Request: timeout option for remote operations, esp. \"git fetch\"","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2013-11-10T20:17:51Z","receivedAt":"2013-11-10T20:17:51Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"\"H. Peter Anvin\" <hpa@zytor.com> wrote:\n> When a remote server is unavailable or very slow, some git commands can\n> stall out indefinitely.  It would be a very good thing if remote\n> commands -- but especially git fetch -- could be given a timeout.\n\nWe've had SO_KEEPALIVE on git and ssh transports since e47a8583 (2011-12-06)\nSO_KEEPALIVE for http was added recently (a15d069a) and will be in git 1.8.5\n\nDo you want a shorter timeout for slow (but still alive) servers?\n"},{"id":"230497","messageId":"52825EBF.3050603@zytor.com","threadId":"35295","inReplyTo":"20131110201751.GA18513@dcvr.yhbt.net","subject":"Re: Request: timeout option for remote operations, esp. \"git fetch\"","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2013-11-12T17:00:47Z","receivedAt":"2013-11-12T17:00:47Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"On 11/10/2013 12:17 PM, Eric Wong wrote:\n> \"H. Peter Anvin\" <hpa@zytor.com> wrote:\n>> When a remote server is unavailable or very slow, some git commands can\n>> stall out indefinitely.  It would be a very good thing if remote\n>> commands -- but especially git fetch -- could be given a timeout.\n> \n> We've had SO_KEEPALIVE on git and ssh transports since e47a8583 (2011-12-06)\n> SO_KEEPALIVE for http was added recently (a15d069a) and will be in git 1.8.5\n> \n> Do you want a shorter timeout for slow (but still alive) servers?\n> \n\nYes; note that SO_KEEPALIVE only guarantees that the server is alive at\nthe TCP socket level.  If the server is overloaded but technically alive\nit may still make no meaningful forward progress.\n\n\t-hpa\n"},{"id":"230502","messageId":"xmqq1u2likea.fsf@gitster.dls.corp.google.com","threadId":"35295","inReplyTo":"52825EBF.3050603@zytor.com","subject":"Re: Request: timeout option for remote operations, esp. \"git fetch\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-11-12T17:45:33Z","receivedAt":"2013-11-12T17:45:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"H. Peter Anvin\" <hpa@zytor.com> writes:\n\n> On 11/10/2013 12:17 PM, Eric Wong wrote:\n>> \"H. Peter Anvin\" <hpa@zytor.com> wrote:\n>>> When a remote server is unavailable or very slow, some git commands can\n>>> stall out indefinitely.  It would be a very good thing if remote\n>>> commands -- but especially git fetch -- could be given a timeout.\n>> \n>> We've had SO_KEEPALIVE on git and ssh transports since e47a8583 (2011-12-06)\n>> SO_KEEPALIVE for http was added recently (a15d069a) and will be in git 1.8.5\n>> \n>> Do you want a shorter timeout for slow (but still alive) servers?\n>> \n>\n> Yes; note that SO_KEEPALIVE only guarantees that the server is alive at\n> the TCP socket level.  If the server is overloaded but technically alive\n> it may still make no meaningful forward progress.\n\nWhich means that your original wish may not be granted with\nSO_KEEPALIVE at all, no?  I was wondering if you wanted a forced\ntimeout based on alarm(2), something similar to what you added to\ngit-daemon in 960deccb (git-daemon: timeout, eliminate double DWIM,\n2005-10-19).\n"},{"id":"230505","messageId":"5282748D.9000907@zytor.com","threadId":"35295","inReplyTo":"xmqq1u2likea.fsf@gitster.dls.corp.google.com","subject":"Re: Request: timeout option for remote operations, esp. \"git fetch\"","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2013-11-12T18:33:49Z","receivedAt":"2013-11-12T18:33:49Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"On 11/12/2013 09:45 AM, Junio C Hamano wrote:\n> \"H. Peter Anvin\" <hpa@zytor.com> writes:\n> \n>> On 11/10/2013 12:17 PM, Eric Wong wrote:\n>>> \"H. Peter Anvin\" <hpa@zytor.com> wrote:\n>>>> When a remote server is unavailable or very slow, some git commands can\n>>>> stall out indefinitely.  It would be a very good thing if remote\n>>>> commands -- but especially git fetch -- could be given a timeout.\n>>>\n>>> We've had SO_KEEPALIVE on git and ssh transports since e47a8583 (2011-12-06)\n>>> SO_KEEPALIVE for http was added recently (a15d069a) and will be in git 1.8.5\n>>>\n>>> Do you want a shorter timeout for slow (but still alive) servers?\n>>>\n>>\n>> Yes; note that SO_KEEPALIVE only guarantees that the server is alive at\n>> the TCP socket level.  If the server is overloaded but technically alive\n>> it may still make no meaningful forward progress.\n> \n> Which means that your original wish may not be granted with\n> SO_KEEPALIVE at all, no?  I was wondering if you wanted a forced\n> timeout based on alarm(2), something similar to what you added to\n> git-daemon in 960deccb (git-daemon: timeout, eliminate double DWIM,\n> 2005-10-19).\n> \n\nYes, something more like that on the client end.  SO_KEEPALIVE is better\nthan nothing, but not really good enough.\n\n\t-hpa\n"},{"id":"230590","messageId":"20131114080122.GA16327@sigill.intra.peff.net","threadId":"35295","inReplyTo":"5282748D.9000907@zytor.com","subject":"Re: Request: timeout option for remote operations, esp. \"git fetch\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-11-14T08:01:22Z","receivedAt":"2013-11-14T08:01:22Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Nov 12, 2013 at 10:33:49AM -0800, H. Peter Anvin wrote:\n\n> > Which means that your original wish may not be granted with\n> > SO_KEEPALIVE at all, no?  I was wondering if you wanted a forced\n> > timeout based on alarm(2), something similar to what you added to\n> > git-daemon in 960deccb (git-daemon: timeout, eliminate double DWIM,\n> > 2005-10-19).\n> > \n> \n> Yes, something more like that on the client end.  SO_KEEPALIVE is better\n> than nothing, but not really good enough.\n\nWould it be enough to just use timeout(1), like:\n\n  timeout 10m git fetch\n\nThat will time the _whole_ fetch operation, which means a legitimately\ngigantic but fast fetch would still fail. Setting a shorter timeout only\nfor periods of inactivity on the network socket would catch killed or\nvery laggy connections. But it would not catch a server that feeds you\ndata at a constant but ridiculously slow rate.\n\n-Peff\n"}]}