nirvdrum / svn2git

Ruby tool for importing existing svn projects into git.
MIT License
2.11k stars 443 forks source link

svn2git processing error #85

Closed ebadedude closed 12 years ago

ebadedude commented 12 years ago

I am not sure if this is an issue with svn2git or something else. when I run the following command:

svn2git file:///path/to/rsync/backup/of/remote/svn/repository/ --authors /path/to/authors/file -v

It seems to run fine and at about 30 minutes into the process, I get the following

Can't fork at /usr/share/perl5/vendor_perl/Git.pm line 1260.

command failed:
2>&1 git svn fetch

Looking at the file Git.pm, I am not sure what should happen:

        my $fh;
        if ($^O eq 'MSWin32') {
                # ActiveState Perl
                #defined $opts{STDERR} and
                #       warn 'ignoring STDERR option - running w/ ActiveState';
                $direction eq '-|' or
                        die 'input pipe for ActiveState not implemented';
                # the strange construction with *ACPIPE is just to
                # explain the tie below that we want to bind to
                # a handle class, not scalar. It is not known if
                # it is something specific to ActiveState Perl or
                # just a Perl quirk.
                tie (*ACPIPE, 'Git::activestate_pipe', $cmd, @args);
                $fh = *ACPIPE;

        } else {
                my $pid = open($fh, $direction);      #####LINE 1260#####
                if (not defined $pid) {
                        throw Error::Simple("open failed: $!");
                } elsif ($pid == 0) {
                        if (defined $opts{STDERR}) {
                                close STDERR;
                        }
                        if ($opts{STDERR}) {
                                open (STDERR, '>&', $opts{STDERR})
                                        or die "dup failed: $!";
                        }
                        _cmd_exec($self, $cmd, @args);
                }
        }

I was hoping someone ran into this issue as well and what they did to resolve it.

ebadedude commented 12 years ago

Not sure how, but this seemed to be a memory issue for me. Also, interesting to note that the command svn2git seems to pick up from where it left off the last time it was run. so if you cannot perform a capacity/memory upgrade (assuming you run into interesting errors), just run the svn2git command again.

fdammeke commented 11 years ago

I ran into the same problem with a huge svn repository, the git command got killed by the oomkiller:

Can't fork at /usr/share/perl5/vendor_perl/Git.pm line 1260.

-- dmesg: Out of memory: Kill process 20606 (git-svn) score 573 or sacrifice child Killed process 20606, UID 1003, (git-svn) total-vm:5586360kB, anon-rss:4799832kB, file-rss:28kB

Reran the git svn fetch command and the process resumed.

nirvdrum commented 11 years ago

Unfortunately this looks like a problem in git-svn, which is part of the official git offering. svn2git is a nicer wrapper to git-svn. Any bugs found in Perl should be reported to the git developers list or their issue tracker.