Python weird state

greg at perceval.be greg at perceval.be
Thu Nov 9 07:45:46 EST 2000


Hello pytoneers,


I run FreeBSD 3.2 with Python 1.5.2 and MySQL 3.23.3.
I met a strange problem with one of the applications i wrote in Python.
This application use the MySQLdb module to connect to the MySQL
server. The MySQLdb.__version__ is : 1.16

The application does the following job: it parses a CSV file (Excel ascii
sheet) and add values to the MySQL db. I don't know if it can help, but
the csvparser generate a lot (depends on the csv file size) of small
queries (mainly insert but select too).

This application was running correctly for 3 month (started automatically
by cron on uploads).

Since yesterday, I met a strange problem. When the process is started, it
does a dozen of queries and then seems to freeze. I looked in the logs of
the mysqld and saw that no more queries where performed. the top shows
that the python process was in a sbwait state.

After looking for information, I found in the kernel sources of freebsd
the sbwait system call: "Wait for data to arrive at/drain from a socket
buffer".

>From here, I understand that python connects to MySQL server through a
Unix socket (Am I wrong with this ?). While the python process was in
this state, I tried to connect to MySQL server and perform some
queries with both the mysql client and through an apache server without
having any problems. 

I restart the FreeBSD server and try to manually launch the
application. It now seems to work correctly. But I don't know what was the
problem, I don't know what I can do to avoid it. I even don't know if the
problem is FreeBSD, MySQL or Python related.

Any clue ? Does someone had a similar problem ?

Gregoire Welraeds
greg at perceval.be
Perceval Development team
-------------------------------------------------------------------------------
Perceval Technologies sa/nv	Tel: +32-2-6409194		
Rue Tenbosch, 9			Fax: +32-2-6403154		
B-1000 Brussels			general information:   info at perceval.net
BELGIUM				technical information: helpdesk at perceval.net
URL: http://www.perceval.be/
-------------------------------------------------------------------------------






More information about the Python-list mailing list