Phillip Pearson - web + electronics notes

tech notes and web hackery from a new zealander who was vaguely useful on the web back in 2002 (see: python community server, the blogging ecosystem, the new zealand coffee review, the internet topic exchange).

2005-10-17

untitled

People have been reporting recently that pycs.net has been going down a lot. I just noticed a minute ago that it had stopped responding to queries, and also that one PostgreSQL process was indicating that it was doing a SELECT query for the the 'pycs' user. straceing the two processes revealed this:

# strace -p (pid of python process)
Process 10043 attached - interrupt to quit
send(4, "s_spam=0 AND usernum=377 AND pos"..., 42, 0 <unfinished ...>
# strace -p (pid of postgres process)
Process 10051 attached - interrupt to quit
send(8, "/www.pills-best.com/online-pharm"..., 8192, 0 <unfinished ...>

i.e., PyCS is sending an SQL query while Postgres is sending a response, presumably to another query.

I wonder what's happening here. It looks like PyCS has gone onto another DB query without finishing up the first one. Damn.

I don't have the time to properly debug this (or do something about comment spam, or fix the Topic Exchange, for that matter!), so for the time being I've changed it to close the DB connection after each dynamic page generation... this should keep it reasonably sane. Fingers crossed.

... more like this: []