{"thread":{"id":"43365","subject":"Re: [PATCH] git-svn: error out when the SVN connection fails during a fetch","startedAt":"2006-11-28T22:06:05Z","lastAt":"2006-12-06T19:45:30Z","messageCount":9,"participants":["Florian Weimer","Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"295566","messageId":"20061128220605.GA1253@localdomain","threadId":"43365","inReplyTo":null,"subject":"[PATCH] git-svn: error out when the SVN connection fails during a fetch","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-11-28T22:06:05Z","receivedAt":"2006-11-28T22:06:05Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"finish_report does seem to return a useful value indicating success\nor failure, so we'll just set a flag when close_edit is called\n(it is not called on failures, nor is abort_edit) and check\nthe flag before proceeding.\n\nThanks to Pazu for pointing this out.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    9 ++++++++-\n 1 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 7942bba..c3ad5ec 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2941,6 +2941,9 @@ sub libsvn_fetch_delta {\n \t$reporter->set_path('', $last_rev, 0, @lock, $pool);\n \t$reporter->finish_report($pool);\n \t$pool->clear;\n+\tunless ($ed->{git_commit_ok}) {\n+\t\tdie \"SVN connection failed somewhere...\\n\";\n+\t}\n \tlibsvn_log_entry($rev, $author, $date, $msg, [$last_commit]);\n }\n \n@@ -3195,6 +3198,9 @@ sub libsvn_new_tree {\n \t\t$reporter->set_path('', $rev, 1, @lock, $pool);\n \t\t$reporter->finish_report($pool);\n \t\t$pool->clear;\n+\t\tunless ($ed->{git_commit_ok}) {\n+\t\t\tdie \"SVN connection failed somewhere...\\n\";\n+\t\t}\n \t} else {\n \t\topen my $gui, '| git-update-index -z --index-info' or croak $!;\n \t\tlibsvn_traverse($gui, '', $SVN->{svn_path}, $rev);\n@@ -3501,7 +3507,8 @@ sub abort_edit {\n \n sub close_edit {\n \tmy $self = shift;\n-\tclose $self->{gui} or croak;\n+\tclose $self->{gui} or croak $!;\n+\t$self->{git_commit_ok} = 1;\n \t$self->SUPER::close_edit(@_);\n }\n \n-- \n1.4.4.1.ge151\n"},{"id":"296889","messageId":"20061128222442.GC1369@localdomain","threadId":"43365","inReplyTo":"20061128220605.GA1253@localdomain","subject":"Re: [PATCH] git-svn: error out when the SVN connection fails during a fetch","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-11-28T22:24:42Z","receivedAt":"2006-11-28T22:24:42Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Eric Wong <normalperson@yhbt.net> wrote:\n> finish_report does seem to return a useful value indicating success\n> or failure, so we'll just set a flag when close_edit is called\n> (it is not called on failures, nor is abort_edit) and check\n> the flag before proceeding.\n\nAlso, this only affects the delta fetcher.  When using the non-delta\nfetch: the SVN libraries will just segfault :)\n\n-- \n"},{"id":"294507","messageId":"871wnget3b.fsf@mid.deneb.enyo.de","threadId":"43365","inReplyTo":"20061128220605.GA1253@localdomain","subject":"Re: [PATCH] git-svn: error out when the SVN connection fails during a fetch","fromName":"Florian Weimer","fromEmail":"fw@deneb.enyo.de","sentAt":"2006-12-03T18:23:52Z","receivedAt":"2006-12-03T18:23:52Z","isPatch":true,"sender":{"key":"fw@deneb.enyo.de","avatar":null},"body":"* Eric Wong:\n\n> finish_report does seem to return a useful value indicating success\n> or failure, so we'll just set a flag when close_edit is called\n> (it is not called on failures, nor is abort_edit) and check\n> the flag before proceeding.\n\nIt seems that this needs some kind of fine-tuning.  Now that git-svn\nuses HTTP keepalive connections, you get a HTTP request error once you\nrun into the server-side request limit.  It seems a bit excessive to\n"},{"id":"297625","messageId":"20061204085253.GA31047@soma","threadId":"43365","inReplyTo":"871wnget3b.fsf@mid.deneb.enyo.de","subject":"Re: [PATCH] git-svn: error out when the SVN connection fails during a fetch","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-12-04T08:52:53Z","receivedAt":"2006-12-04T08:52:53Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Florian Weimer <fw@deneb.enyo.de> wrote:\n> * Eric Wong:\n> \n> > finish_report does seem to return a useful value indicating success\n> > or failure, so we'll just set a flag when close_edit is called\n> > (it is not called on failures, nor is abort_edit) and check\n> > the flag before proceeding.\n> \n> It seems that this needs some kind of fine-tuning.  Now that git-svn\n> uses HTTP keepalive connections, you get a HTTP request error once you\n> run into the server-side request limit.  It seems a bit excessive to\n> stop completely in this case.\n\nDoes the following patch help?\n\nFrom: Eric Wong <normalperson@yhbt.net>\nDate: Mon, 4 Dec 2006 00:51:16 -0800\nSubject: [PATCH] git-svn: avoid network timeouts for long-running fetches\n\nLong-running fetches run inside children to avoid memory leaks.\nWhen we refork, the connection in the parent can be idle for a\nlong time; attempting to reuse it in the next child can result\nin timeouts.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex d0bd0bd..747daf0 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -459,6 +459,7 @@ sub fetch_lib {\n \t\t$min = $max + 1;\n \t\t$max += $inc;\n \t\t$max = $head if ($max > $head);\n+\t\t$SVN = libsvn_connect($SVN_URL);\n \t}\n \trestore_index($index);\n \treturn { revision => $last_rev, commit => $last_commit };\n-- \n"},{"id":"295119","messageId":"87zma4yr71.fsf@mid.deneb.enyo.de","threadId":"43365","inReplyTo":"20061204085253.GA31047@soma","subject":"Re: [PATCH] git-svn: error out when the SVN connection fails during a fetch","fromName":"Florian Weimer","fromEmail":"fw@deneb.enyo.de","sentAt":"2006-12-04T08:56:50Z","receivedAt":"2006-12-04T08:56:50Z","isPatch":true,"sender":{"key":"fw@deneb.enyo.de","avatar":null},"body":"* Eric Wong:\n\n> Does the following patch help?\n\nDon't think so.  The issue is not timing-related.  I've seen a failure\nevery 1000 requests, which suggests to me that it's hitting the\n"},{"id":"297700","messageId":"20061204090549.GB30316@hand.yhbt.net","threadId":"43365","inReplyTo":"87zma4yr71.fsf@mid.deneb.enyo.de","subject":"Re: [PATCH] git-svn: error out when the SVN connection fails during a fetch","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-12-04T09:05:49Z","receivedAt":"2006-12-04T09:05:49Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Florian Weimer <fw@deneb.enyo.de> wrote:\n> * Eric Wong:\n> \n> > Does the following patch help?\n> \n> Don't think so.  The issue is not timing-related.  I've seen a failure\n> every 1000 requests, which suggests to me that it's hitting the\n> MaxKeepAliveRequests limit configured on the server.\n\nActually, that's exactly what this patch should fix.  git-svn restarts a\nchild every 1000 revisions to avoid memory usage from going through the\nroof.\n\n-- \n"},{"id":"294634","messageId":"87psax3qmb.fsf@mid.deneb.enyo.de","threadId":"43365","inReplyTo":"20061204090549.GB30316@hand.yhbt.net","subject":"Re: [PATCH] git-svn: error out when the SVN connection fails during a fetch","fromName":"Florian Weimer","fromEmail":"fw@deneb.enyo.de","sentAt":"2006-12-06T17:01:48Z","receivedAt":"2006-12-06T17:01:48Z","isPatch":true,"sender":{"key":"fw@deneb.enyo.de","avatar":null},"body":"* Eric Wong:\n\n> Florian Weimer <fw@deneb.enyo.de> wrote:\n>> * Eric Wong:\n>> \n>> > Does the following patch help?\n>> \n>> Don't think so.  The issue is not timing-related.  I've seen a failure\n>> every 1000 requests, which suggests to me that it's hitting the\n>> MaxKeepAliveRequests limit configured on the server.\n>\n> Actually, that's exactly what this patch should fix.  git-svn restarts a\n> child every 1000 revisions to avoid memory usage from going through the\n> roof.\n\n"},{"id":"294989","messageId":"7v64co4zo0.fsf@assigned-by-dhcp.cox.net","threadId":"43365","inReplyTo":"87psax3qmb.fsf@mid.deneb.enyo.de","subject":"Re: [PATCH] git-svn: error out when the SVN connection fails during a fetch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-06T19:01:03Z","receivedAt":"2006-12-06T19:01:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Florian Weimer <fw@deneb.enyo.de> writes:\n\n> * Eric Wong:\n>\n>> Florian Weimer <fw@deneb.enyo.de> wrote:\n>>> * Eric Wong:\n>>> \n>>> > Does the following patch help?\n>>> \n>>> Don't think so.  The issue is not timing-related.  I've seen a failure\n>>> every 1000 requests, which suggests to me that it's hitting the\n>>> MaxKeepAliveRequests limit configured on the server.\n>>\n>> Actually, that's exactly what this patch should fix.  git-svn restarts a\n>> child every 1000 revisions to avoid memory usage from going through the\n>> roof.\n>\n> Oh.  My (limited) testing of the patch confirms that.\n\nOk, so this means I should apply this one, right?\n\n-- >8 --\nFrom: Eric Wong <normalperson@yhbt.net>\nDate: Mon, 4 Dec 2006 00:51:16 -0800\nSubject: [PATCH] git-svn: avoid network timeouts for long-running fetches\n\nLong-running fetches run inside children to avoid memory leaks.\nWhen we refork, the connection in the parent can be idle for a\nlong time; attempting to reuse it in the next child can result\nin timeouts.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex d0bd0bd..747daf0 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -459,6 +459,7 @@ sub fetch_lib {\n \t\t$min = $max + 1;\n \t\t$max += $inc;\n \t\t$max = $head if ($max > $head);\n+\t\t$SVN = libsvn_connect($SVN_URL);\n \t}\n \trestore_index($index);\n \treturn { revision => $last_rev, commit => $last_commit };\n-- \n1.4.4.1.g6129\n"},{"id":"294666","messageId":"20061206194530.GA24986@localdomain","threadId":"43365","inReplyTo":"7v64co4zo0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-svn: error out when the SVN connection fails during a fetch","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-12-06T19:45:30Z","receivedAt":"2006-12-06T19:45:30Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> Florian Weimer <fw@deneb.enyo.de> writes:\n> \n> > * Eric Wong:\n> >\n> >> Florian Weimer <fw@deneb.enyo.de> wrote:\n> >>> * Eric Wong:\n> >>> \n> >>> > Does the following patch help?\n> >>> \n> >>> Don't think so.  The issue is not timing-related.  I've seen a failure\n> >>> every 1000 requests, which suggests to me that it's hitting the\n> >>> MaxKeepAliveRequests limit configured on the server.\n> >>\n> >> Actually, that's exactly what this patch should fix.  git-svn restarts a\n> >> child every 1000 revisions to avoid memory usage from going through the\n> >> roof.\n> >\n> > Oh.  My (limited) testing of the patch confirms that.\n> \n> Ok, so this means I should apply this one, right?\n\nYes, please do.  Thanks.\n\n-- \n"}]}