Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Problem with mysql api calls.

Reply
Thread Tools

Problem with mysql api calls.

 
 
jwl@sgi.com
Guest
Posts: n/a
 
      08-23-2004
I'm having a problem with a bit of code that I have "adopted". It was
partially complete when I took it over. The function of the code is to
read a log file, locate files described in that log file and fill in a
few tables in a couple of MySql databases. The program is using a
number of std objects, hashmaps, linklists, vectors etc. It makes
direct calls to the MySql api. The version of MySql is 3.23.58.
Redhat 9, g++ (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) on a Intel
IA32 system.

The problem is that after some number of transactions, the call to
connect to the server fails with the error:
Can't create TCP/IP socket (24)

I did a Google search for that error message and nothing came up that
seemed to fit.

I was able to aggrevate the situation by adding a heartbeat update that
simply put the current date in a table periodically. If I set the
interval short, to one minute, it would fail in a couple of hours. If I
bumped it up to 10 minutes, it took 2.5 days to fail. So I moved that
code to a completely separate process, via a fork call. It didn't
improve anything.

I have integrated the Electric Fence library into the program and set
all the various options to try to catch malloc problems. I found one,
but fixing it didn't have any effect on the failure.

I'm not looking for a solution but ideas on where to go next to isolate
the failure. I belive the failure is a symptom of the problem and not
the problem itself. During previous attempts to find the problem I
found the open of the log file would fail after a number of successful
attempts. And it is the total number of transactions that seems to
give me the trouble, but it doesn't really care which of the two
databases that I'm accessing/updating, it's just the total number. In
fact the heartbeat update is being done to one and the failure is on the
other one.

Any suggestions as to what I might do? Any ideas on tools that might
tell me what's up? I forgot to mention this is a muli-threaded app. 7
threads running, mostly in a sleep state. CPU load is very low. All
the threads are started at the beginning and are not recreated.
Changing the code to open DB once and update many times, vs open
everytime we update had no effect.

Thanks for any assistance.

Jim.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with mysql c API and c alexkon1250@yahoo.gr C Programming 5 04-21-2006 07:21 PM
[Mysql Api] Problem with tables listing kilian C Programming 5 06-12-2005 07:04 PM
"mysql.h: No such file or directory" when building MySQL-python francescomoi@europe.com Python 2 05-11-2005 03:12 PM
DBD:mysql doesn't read mysql option file /etc/my.cnf file JL Perl 0 01-28-2005 03:19 AM
"Pure Python" MySQL module like Net::MySQL Ravi Python 6 07-21-2003 06:53 PM



Advertisments