freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Pickett, Mark J" <mark.j.pickett AT xo.com>
- To: <freetds AT lists.ibiblio.org>
- Subject: [freetds] DB crash causes Perl script to hang
- Date: Wed, 23 Jul 2003 17:52:43 -0400
I use FreeTDS to connect to Micromuse Netcool, which is built on Sybase
libraries.
Before I forget, here are my versions:
Solaris 9
FreeTDS 0.61
Perl 5.8.0
DBI 1.37
DBD::Sybase 1.00
Sybase 11.1.1 and 12.5.0 (problem occurs on both versions)
I'm having a problem where I successfully connect to the DB, the DB
crashes later on, and the Perl script will hang and begin to take up to
50% CPU on my server. My script won't write to its log or even run any
of the subroutines are supposed to be called when the DB functions
return errors. It appears that calls to the DB will wait forever for a
response. I've been able to duplicate the problem with even this simple
script:
#!/usr/bin/perl
BEGIN {
$ENV{'SYBASE'} = '/usr/local/freetds/';
}
use strict;
use warnings;
use DBI;
use DBD::Sybase;
my $dbh = DBI->connect("dbi:Sybase:server=foo",'bar','baz')
or die "Can't connect to foo: $DBI::errstr";
sleep 20;
print "Finished sleeping\n";
my $rc = $dbh->ping;
if ($rc) {
print "DB up\n";
} else {
print "DB down\n";
}
$dbh->disconnect;
print "Shutting down...\n";
I can allow the script to connect, and while the script is sleeping, I
can shut down the DB, and the ping will never return. It will print
"Finished sleeping" and start to take up CPU. It won't even print "DB
down." Here is the freetds.log:
2003-07-23 16:42:01 Connecting addr 10.76.109.135 port 4101
Sending packet @ 2003-07-23 16:42:01
<packet dump snipped>
Sending packet @ 2003-07-23 16:42:01
<packet dump snipped>
2003-07-23 16:42:01 inside tds_process_login_tokens()
Received packet @ 2003-07-23 16:42:01
<packet dump snipped>
2003-07-23 16:42:01 inside tds_process_default_tokens() marker is e2
2003-07-23 16:42:01 inside tds_process_default_tokens() marker is fd
2003-07-23 16:42:01 leaving tds_process_login_tokens() returning 1
2003-07-23 16:42:01 leaving ct_connect() returning 1
2003-07-23 16:42:01 inside ct_options() action = CS_GET option = 7
2003-07-23 16:42:21 inside ct_cmd_alloc()
2003-07-23 16:42:21 inside ct_command()
2003-07-23 16:42:21 inside ct_send()
Sending packet @ 2003-07-23 16:42:21
<packet dump snipped>
2003-07-23 16:42:21 ct_send() succeeded
2003-07-23 16:42:21 inside ct_results()
It won't ever return from the ping. Has anyone else seen this problem?
Thanks in advance for the help.
Thanks,
Mark Pickett
Network Service Assurance
XO Communications
-
[freetds] DB crash causes Perl script to hang,
Pickett, Mark J, 07/23/2003
- Re: [freetds] DB crash causes Perl script to hang, James K. Lowden, 07/23/2003
- <Possible follow-up(s)>
- [freetds] DB crash causes Perl script to hang, Pickett, Mark J, 07/24/2003
Archive powered by MHonArc 2.6.24.