[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Fwd: Error during repetative calls to cat

From: Ed Hillmann <edhillmann_at_yahoo.com>
Date: 2005-06-17 07:17:43 CEST

I've found some other messages where people were
getting the same kind of error. And it looks like it
has to do with the system limit on simultaneously open
files.

When I run the script

#!/usr/bin/perl -w
use strict;
use IO::File;
my @tempfiles;
for my $i (1 .. 2000) {
my $fh = IO::File->new_tmpfile();
die "Failed to created file number $i.\n" unless
defined $fh;
push @tempfiles, $fh;
}

I get

Failed to created file number 254.

So, there is a system limit, and I don't think I can
change that.

However, my test of ctx->cat is simply opening the
same file repeatedly. Does that mean that the cat
command in the libsvn_client library (which is being
linked to by the perl script) is not cleaning up any
handles?

I know I'm closing the handle that I open. Would
there be something else in the local File support that
is opening something and not closing?

I guess I should try doing the same thing in C, but if
anyone has any clues, I'd love any insight.

Thanks,
Ed

Send instant messages to your online friends http://au.messenger.yahoo.com

attached mail follows:


I'm using the Perl bindings to access a SVN
repository. I'm doing performance timings, so I have
a simple loop that goes through for a single file, and
isses the same command multiple times....

sub test_svn_cat {
    my $srcUrl = shift;
    my $srcRevision = shift;
    my $targetPath = shift;
    
    my $err;

    open(OUTPUT_HANDLE, ">$targetPath/svnOutput.txt");
    $err = $ctx->cat(\*OUTPUT_HANDLE, $srcUrl,
$srcRevision);

    if (!close(OUTPUT_HANDLE)) {
        print "Close failed: $!\n";
        return 0;
    }
    return 1;
}

sub test_svn_cat_loop {
    my $srcUrl = shift;
    my $srcRevision = shift;
    my $targetPath = shift;
    my $svnCatFn = \&test_svn_cat;

    print "\nTesting SVN Cat ($ITERATIONS
iterations)\n";
    print "Getting Revision $srcRevision of $srcUrl
...\n";

        
    my $t0 = [gettimeofday];

    my $local_iter = 0;
    while ($local_iter < $ITERATIONS) {
            &$svnCatFn($srcUrl, $srcRevision, $targetPath);
        $local_iter++;
    }
    
    my $t1 = [gettimeofday];
    
    $t0_t1 = tv_interval $t0, $t1;
    
    my $avg = $t0_t1 / $ITERATIONS;
    
    print "Test SVN Cat\n";
    print "------------\n";
    print " # of iters: $ITERATIONS\n";
    print " elapsed time (seconds): $t0_t1\n";
    print " avg: $avg\n";
    
}
test_svn_cat_loop
('file:///ct/acct/ehillman/svnRepos/trunk/conftool/docobj/build.xml',
16009,
'/ct/acct/ehillman/svnPerformance/perl/output');

When the URL being passed into the cat method is an
svn url (for example,
"svn://machineName/trunk/conftool/docobj/build.xml"),
it works fine. My default iteration count is 100.

When I pass it a file URL (for example,
"file:///ct/acct/ehillman/svnRepos/trunk/conftool/docobj/build.xml"),
it fails on the 43rd iteration. So, if my iteration
count is less than that, it works without a problem.
But once it hits that number, I get an error.

It's also complaining when it fails that it can't find
Carp/Heavy.pm, which I don't understand because it's
in its PERL5LIB.

Anyways, has anyone come across this before?

Thanks,
Ed

Send instant messages to your online friends http://au.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jun 17 07:19:45 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.