[Zope] urgent stability problem on production site
Matthew T. Kromer
matt@zope.com
Wed, 30 Jan 2002 13:17:40 -0500
Frank Tegtmeyer wrote:
>"Matthew T. Kromer" <matt@zope.com> writes:
>
>>Frank, try starting Zope up single-threaded ( -t 1 ) and see if that
>>helps; I'm nervous about a potential problem with the MySQLDA C
>>libraries having thread-local data and switching threads leading to
>>instability.
>>
>
>I have set this - now Zope doesn't want to die :) I will have to wait
>for the next error to see the effect.
>
>>We've had one customer who 'made the problems go away'
>>when they ran single-threaded Zope.
>>
>
>Interesting - aren't the MySQL connections bound to a thread? YOu mean
>there may be a bug at a lower level than mysql-python?
>
>Regards, Frank
>
Well, I'm worried about the MySQL libraries. You can build them either
in threaded or nonthreaded mode; and the default setup of ZMySQLDA was
to use the nonthreaded libraries. So that's a problem right there.
Secondly, Andy Dustman thought that certain library objects were
thread-bound -- so you couldn't allocate a connection object on one
thread and then invoke it from another. Zope would try to do that as
part of the DA connection pooling. I have a patch for ZMySQLDA which
tries to close and reopen the MySQL connection when the DA connection
object switches threads, but I haven't ever heard from someone "this
fixes it!"
I personally haven't got a reproducable test case in house to try to
diagnose the MySQL problems. When I do simple queries etc by banging on
the Zope SQL Methods with "ab" I don't have MySQL fail.