git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* git-svn: libsvn-perl_1.4.4 and do_switch()
@ 2007-06-26 13:37 Gerrit Pape
  2007-07-04  8:04 ` Gerrit Pape
  2007-07-04 21:07 ` [PATCH] git-svn: fix blocking with svn:// servers after do_switch Eric Wong
  0 siblings, 2 replies; 9+ messages in thread
From: Gerrit Pape @ 2007-06-26 13:37 UTC (permalink / raw)
  To: git

Hi, on Debian unstable the current version of libsvn-perl is 1.4.4dfsg1.
With this version git-svn uses do_switch instead of do_update, which
seems to not work properly, please see

 http://bugs.debian.org/430091

on how to reproduce the problem.  The following also is showing a
problem, as it blocks in read() after do_switch

 git svn clone -T trunk -b branches -t tags \
   svn://bruce-guenter.dyndns.org/bglibs

I'm not sure whether this is a git-svn or a subversion problem, thanks
for your input.

Regards, Gerrit.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git-svn: libsvn-perl_1.4.4 and do_switch()
  2007-06-26 13:37 git-svn: libsvn-perl_1.4.4 and do_switch() Gerrit Pape
@ 2007-07-04  8:04 ` Gerrit Pape
  2007-07-04 21:07 ` [PATCH] git-svn: fix blocking with svn:// servers after do_switch Eric Wong
  1 sibling, 0 replies; 9+ messages in thread
From: Gerrit Pape @ 2007-07-04  8:04 UTC (permalink / raw)
  To: git

On Tue, Jun 26, 2007 at 01:37:04PM +0000, Gerrit Pape wrote:
> Hi, on Debian unstable the current version of libsvn-perl is 1.4.4dfsg1.
> With this version git-svn uses do_switch instead of do_update, which
> seems to not work properly, please see
> 
>  http://bugs.debian.org/430091
> 
> on how to reproduce the problem.

Hi, more people ran into this problem, and reported through
 http://bugs.debian.org/430091
  
Can anyone confirm that this is a bug in subversion 1.4.4, or is it a
bug in git-svn?

Thanks, Gerrit.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] git-svn: fix blocking with svn:// servers after do_switch
  2007-06-26 13:37 git-svn: libsvn-perl_1.4.4 and do_switch() Gerrit Pape
  2007-07-04  8:04 ` Gerrit Pape
@ 2007-07-04 21:07 ` Eric Wong
  2007-08-07 13:42   ` git-svn: "Malformed network data" issue Gerrit Pape
  1 sibling, 1 reply; 9+ messages in thread
From: Eric Wong @ 2007-07-04 21:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, 430091

We now explicitly disconnect before starting new SVN::Ra
connections.  SVN::Ra objects will automatically be disconnected
from the server on DESTROY.

SVN servers seem to have problems accepting multiple connections
from one client, and the SVN library has trouble being connected
to multiple servers at once.  This appears to cause opening the
second connection to block, and cause git-svn to be unusable
after using the do_switch() function.

git-svn opens another connection because a workaround is
necesary for the buggy reparent function handling on certain
versions of svn:// and svn+ssh:// servers.  Instead of using the
reparent function (analogous to chdir), it will reopen a new
connection to a different URL on the SVN server.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---

  Gerrit Pape <pape@smarden.org> wrote:
  > Hi, on Debian unstable the current version of libsvn-perl is 1.4.4dfsg1.
  > With this version git-svn uses do_switch instead of do_update, which
  > seems to not work properly, please see
  > 
  >  http://bugs.debian.org/430091
  > 
  > on how to reproduce the problem.  The following also is showing a
  > problem, as it blocks in read() after do_switch
  > 
  >  git svn clone -T trunk -b branches -t tags \
  >    svn://bruce-guenter.dyndns.org/bglibs
  > 
  > I'm not sure whether this is a git-svn or a subversion problem, thanks
  > for your input.

  Thanks for the bug report.  Sorry for the latency these days, I've
  been quite busy with other things.

  Although this fixes blocking reads, this does *not* fix the
  "Malformed network data" issue, which has been around for a
  while...

  I'll try to find time to fix the "Malformed network data" bug
  in a few days time, but it's not fatal (just restart git-svn,
  this error happens at a point where it's not possible to have
  a corrupted import).

 git-svn.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 51979f9..b3dffcc 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3002,6 +3002,7 @@ sub new {
 	      \&Git::SVN::Prompt::username, 2),
 	  ]);
 	my $config = SVN::Core::config_get_config($config_dir);
+	$RA = undef;
 	my $self = SVN::Ra->new(url => $url, auth => $baton,
 	                      config => $config,
 			      pool => SVN::Pool->new,
-- 
Eric Wong

^ permalink raw reply	[flat|nested] 9+ messages in thread

* git-svn: "Malformed network data" issue
  2007-07-04 21:07 ` [PATCH] git-svn: fix blocking with svn:// servers after do_switch Eric Wong
@ 2007-08-07 13:42   ` Gerrit Pape
  2007-09-07  7:34     ` [PATCH] git-svn: fix "Malformed network data" with svn:// servers Eric Wong
  0 siblings, 1 reply; 9+ messages in thread
From: Gerrit Pape @ 2007-08-07 13:42 UTC (permalink / raw)
  To: git, Eric Wong

On Wed, Jul 04, 2007 at 02:07:42PM -0700, Eric Wong wrote:
>   Although this fixes blocking reads, this does *not* fix the
>   "Malformed network data" issue, which has been around for a
>   while...
> 
>   I'll try to find time to fix the "Malformed network data" bug
>   in a few days time, but it's not fatal (just restart git-svn,
>   this error happens at a point where it's not possible to have
>   a corrupted import).

Hi, this still is a problem we face on Debian with 1.5.3-rc3
 http://bugs.debian.org/436142
 http://bugs.debian.org/430091

I'm sorry, I didn't manage to provide a patch.

Thanks, Gerrit.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] git-svn: fix "Malformed network data" with svn:// servers
  2007-08-07 13:42   ` git-svn: "Malformed network data" issue Gerrit Pape
@ 2007-09-07  7:34     ` Eric Wong
  2007-09-07 10:07       ` Eric Wong
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Wong @ 2007-09-07  7:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, 430091

We have a workaround for the reparent function not working
correctly on the SVN native protocol servers.  This workaround
opens a new connection (SVN::Ra object) to the new
URL/directory.

Since libsvn appears limited to only supporting one connection
at a time, this workaround invalidates the Git::SVN::Ra object
that is $self inside gs_fetch_loop_common().  So we need to
restart that connection once all the fetching is done for each
loop iteration to be able to run get_log() successfully.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---

  Gerrit Pape <pape@smarden.org> wrote:
  > On Wed, Jul 04, 2007 at 02:07:42PM -0700, Eric Wong wrote:
  > >   Although this fixes blocking reads, this does *not* fix the
  > >   "Malformed network data" issue, which has been around for a
  > >   while...
  > > 
  > >   I'll try to find time to fix the "Malformed network data" bug
  > >   in a few days time, but it's not fatal (just restart git-svn,
  > >   this error happens at a point where it's not possible to have
  > >   a corrupted import).
  > 
  > Hi, this still is a problem we face on Debian with 1.5.3-rc3
  >  http://bugs.debian.org/436142
  >  http://bugs.debian.org/430091
  > 
  > I'm sorry, I didn't manage to provide a patch.

  Sorry for the latency again.

 git-svn.perl |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index d3c8cd0..7df4098 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3175,6 +3175,7 @@ sub gs_do_switch {
 			$reparented = 1;
 		} else {
 			$ra = Git::SVN::Ra->new($full_url);
+			$self->{-invalid} = 1;
 		}
 	}
 	$ra ||= $self;
@@ -3310,6 +3311,11 @@ sub gs_fetch_loop_common {
 		$min = $max + 1;
 		$max += $inc;
 		$max = $head if ($max > $head);
+		if ($self->{-invalid}) {
+			my $ra_url = $self->{url};
+			$self = undef;
+			$self = Git::SVN::Ra->new($ra_url);
+		}
 	}
 }
 
-- 
Eric Wong

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] git-svn: fix "Malformed network data" with svn:// servers
  2007-09-07  7:34     ` [PATCH] git-svn: fix "Malformed network data" with svn:// servers Eric Wong
@ 2007-09-07 10:07       ` Eric Wong
  2007-09-07 11:00         ` [PATCH (try 2)] " Eric Wong
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Wong @ 2007-09-07 10:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, 430091

Eric Wong <normalperson@yhbt.net> wrote:
> We have a workaround for the reparent function not working
> correctly on the SVN native protocol servers.  This workaround
> opens a new connection (SVN::Ra object) to the new
> URL/directory.
> 
> Since libsvn appears limited to only supporting one connection
> at a time, this workaround invalidates the Git::SVN::Ra object
> that is $self inside gs_fetch_loop_common().  So we need to
> restart that connection once all the fetching is done for each
> loop iteration to be able to run get_log() successfully.
> 
> Signed-off-by: Eric Wong <normalperson@yhbt.net>

Actually, drop this for now.  Seems to cause the SVN to block
when doing do_switch() again...

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH (try 2)] git-svn: fix "Malformed network data" with svn:// servers
  2007-09-07 10:07       ` Eric Wong
@ 2007-09-07 11:00         ` Eric Wong
  2008-02-08 16:24           ` Gerrit Pape
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Wong @ 2007-09-07 11:00 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, 430091

We have a workaround for the reparent function not working
correctly on the SVN native protocol servers.  This workaround
opens a new connection (SVN::Ra object) to the new
URL/directory.

Since libsvn appears limited to only supporting one connection
at a time, this workaround invalidates the Git::SVN::Ra object
that is $self inside gs_fetch_loop_common().  So we need to
restart that connection once all the fetching is done for each
loop iteration to be able to run get_log() successfully.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index d3c8cd0..fbd4691 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3013,7 +3013,7 @@ package Git::SVN::Ra;
 use vars qw/@ISA $config_dir $_log_window_size/;
 use strict;
 use warnings;
-my ($can_do_switch, %ignored_err, $RA);
+my ($ra_invalid, $can_do_switch, %ignored_err, $RA);
 
 BEGIN {
 	# enforce temporary pool usage for some simple functions
@@ -3174,7 +3174,11 @@ sub gs_do_switch {
 			$self->{url} = $full_url;
 			$reparented = 1;
 		} else {
+			$_[0] = undef;
+			$self = undef;
+			$RA = undef;
 			$ra = Git::SVN::Ra->new($full_url);
+			$ra_invalid = 1;
 		}
 	}
 	$ra ||= $self;
@@ -3234,6 +3238,7 @@ sub gs_fetch_loop_common {
 	my $inc = $_log_window_size;
 	my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
 	my $longest_path = longest_common_path($gsv, $globs);
+	my $ra_url = $self->{url};
 	while (1) {
 		my %revs;
 		my $err;
@@ -3295,6 +3300,13 @@ sub gs_fetch_loop_common {
 				        "$g->{t}-maxRev";
 				Git::SVN::tmp_config($k, $r);
 			}
+			if ($ra_invalid) {
+				$_[0] = undef;
+				$self = undef;
+				$RA = undef;
+				$self = Git::SVN::Ra->new($ra_url);
+				$ra_invalid = undef;
+			}
 		}
 		# pre-fill the .rev_db since it'll eventually get filled in
 		# with '0' x40 if something new gets committed
-- 
Eric Wong

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH (try 2)] git-svn: fix "Malformed network data" with svn:// servers
  2007-09-07 11:00         ` [PATCH (try 2)] " Eric Wong
@ 2008-02-08 16:24           ` Gerrit Pape
  2008-04-18 13:25             ` Gerrit Pape
  0 siblings, 1 reply; 9+ messages in thread
From: Gerrit Pape @ 2008-02-08 16:24 UTC (permalink / raw)
  To: Eric Wong; +Cc: Junio C Hamano, git

On Fri, Sep 07, 2007 at 04:00:40AM -0700, Eric Wong wrote:
> We have a workaround for the reparent function not working
> correctly on the SVN native protocol servers.  This workaround
> opens a new connection (SVN::Ra object) to the new
> URL/directory.

Hi, this problem popped up again, please see
 http://bugs.debian.org/464713
 
I can reproduce it with v1.5.4 through

 $ git svn clone svn://svn.debian.org/chinese/packages/lunar-applet
 [...]
 r159 = 010d0b481753bd32ce0255ce433d63e14114d3b6 (git-svn@159)
 Found branch parent: (git-svn) 010d0b481753bd32ce0255ce433d63e14114d3b6
 Following parent with do_switch
 Malformed network data: Malformed network data at /usr/bin/git-svn line
 2251

 $ 

Regards, Gerrit.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH (try 2)] git-svn: fix "Malformed network data" with svn:// servers
  2008-02-08 16:24           ` Gerrit Pape
@ 2008-04-18 13:25             ` Gerrit Pape
  0 siblings, 0 replies; 9+ messages in thread
From: Gerrit Pape @ 2008-04-18 13:25 UTC (permalink / raw)
  To: Eric Wong; +Cc: Junio C Hamano, git

On Fri, Feb 08, 2008 at 04:24:33PM +0000, Gerrit Pape wrote:
> On Fri, Sep 07, 2007 at 04:00:40AM -0700, Eric Wong wrote:
> > We have a workaround for the reparent function not working
> > correctly on the SVN native protocol servers.  This workaround
> > opens a new connection (SVN::Ra object) to the new
> > URL/directory.
> 
> Hi, this problem popped up again, please see
>  http://bugs.debian.org/464713
>  
> I can reproduce it with v1.5.4 through
> 
>  $ git svn clone svn://svn.debian.org/chinese/packages/lunar-applet
>  [...]
>  r159 = 010d0b481753bd32ce0255ce433d63e14114d3b6 (git-svn@159)
>  Found branch parent: (git-svn) 010d0b481753bd32ce0255ce433d63e14114d3b6
>  Following parent with do_switch
>  Malformed network data: Malformed network data at /usr/bin/git-svn line
>  2251

Hi, the problem seems to persist, this is 1.5.5:

$ rm -rf lunar-applet && rm -rf lunar-applet &&
  git version &&
  git svn clone svn://svn.debian.org/chinese/packages/lunar-applet 2>&1 |
    tail -n 14
git version 1.5.5
r155 = e99aaa44f7c306d631501b949a0b35be162c1447 (git-svn@159)
        M       debian/copyright
r156 = d94a736d4b89e3f54ca36b0fc827929050a48a5c (git-svn@159)
        M       debian/doc-base
r157 = bf2661df6d35a88ff40a6aea9829fbbc94a5c06b (git-svn@159)
        M       debian/changelog
r158 = 1107cff6309c979751e0841d40b9e2e471694b26 (git-svn@159)
        M       debian/changelog
        M       debian/rules
r159 = 010d0b481753bd32ce0255ce433d63e14114d3b6 (git-svn@159)
Found branch parent: (git-svn) 010d0b481753bd32ce0255ce433d63e14114d3b6
Following parent with do_switch
Malformed network data: Malformed network data at /usr/bin/git-svn line 2270


I can't to suggest a fix, sorry.

Thanks, Gerrit.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-04-18 13:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-26 13:37 git-svn: libsvn-perl_1.4.4 and do_switch() Gerrit Pape
2007-07-04  8:04 ` Gerrit Pape
2007-07-04 21:07 ` [PATCH] git-svn: fix blocking with svn:// servers after do_switch Eric Wong
2007-08-07 13:42   ` git-svn: "Malformed network data" issue Gerrit Pape
2007-09-07  7:34     ` [PATCH] git-svn: fix "Malformed network data" with svn:// servers Eric Wong
2007-09-07 10:07       ` Eric Wong
2007-09-07 11:00         ` [PATCH (try 2)] " Eric Wong
2008-02-08 16:24           ` Gerrit Pape
2008-04-18 13:25             ` Gerrit Pape

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).