Archaeopteryx Software, Inc.
Take Flight!Search

Home
Wing IDE
News
Support
About Us
Python
Open Source
Store

 Search:
 
 Advanced Search




[wingide-users] Zope: ZRendezvous.py patch doesn't work with ZEO clients

Stephan R.A. Deibel sdeibel@archaeopteryx.com
Wed, 14 Mar 2001 23:44:02 -0500 (EST)


Hi,

The patch makes ZServer run with a single thread only.  I don't know that
much about ZEO internals but am guessing that the client/server connection
doesn't get serviced or deadlocks in the single threaded case.

We make two changes to Zope:  One in ZRendezvous.py to prevent servicing
requests in a new thread, and another in 'start' to specify '-t 0' in the
invocation to z2.py so only one thread is started initially.  In addition
to this, wingdbstub installs its network socket into Zope's asyncore for
select() servicing (this is not in the patch, but in the debugger code
itself).

You may be able to get things to work by running without the patch and
placing your 'import wingdbstub' call not in z2.py but instead at a
location that will get executed by the thread that you want to debug.  
Only that thread will stop at breakpoints, etc.  Obviously, this can 
get confusing if you're not sure what thread is executing code, so placing
the 'import wingdbstub' close to the code you want to step through is 
best.  See section 6.11 in the manual if you're not familiar with
how wingdbstub works.

It's conceivable that you will run into problems with the asyncore socket
registration in the multi-threaded case.  If there are fatal problems with
the asyncore registration, you can disable this by altering the source
code in WINGHOME/bin/[1.5.2|2.0.0]/src/debug/server/_zopehooks.py (1.5.2
or 2.0.0 depending on the version of Python you're using). This comes in
source form even in the binary distribution, and disabling it will just
mean that you cannot set new breakpoints during a debug run or pause a
free-running program (not a fatal problem as long as you understand the
limitation). Take a look at section 6.16 of the version 1.1b3 manual for
details on this.

I should note that this is just theory at this point, as we haven't
recently tried debugging in a multi-threaded app.  I at least wanted to
explain what is happening and point you at the stuff that's relevant and
might help you solve your problem.

The bottom line is that the current debugger only supports debugging one
thread, but you may be able to make it work with some limitations.
Multi-threaded and multi-process debugging is planned but is still some
months in the future.

Hope this helps, or at least saves you some time... obviously, an
alternative is to try to get ZEO working in the single-threaded case, but
I don't know enough about that to suggest how this might be done.

- Stephan

------------------------------------------------------------------------
Archaeopteryx Software, Inc.                        Wing IDE for Python 
www.archaeopteryx.com                               Take Flight!



On Wed, 14 Mar 2001, Dan L. Pierson wrote:

> Wing 1.1b3, Zope CVS checkout just before Python 9 (i.e. 2.3.1b1+).
> 
> Wing does work if I apply the patches and start up ZServer normally with 
> your version of the start script.  Starting a ZEO storage server is fine. 
> If I then
> try to start a ZEO client, it works without the patch and fails with it 
> consistently.  By fails, I mean that:
> 
> 1. Connections to the client are not reponded to and eventually time out.
> 
> 2. The client cache file (e.g. var/c1-8800.zec) quickly reaches a fixed 
> size
> of about 96k and never grows.  With a properly working client and my test 
> site it grows to over 500k by the time the page is displayed.
> 
> I haven't tried to debug what's happening.
> 
> Dan Pierson
> Control.com, Inc.
> 
> 
> 
> _________________________________________________
> Archaeopteryx Software, Inc.
> Wing IDE discussion list
> http://archaeopteryx.com/mailman/listinfo/wingide-users
> 






Run by Mailman v 2.0.8


Copyright (c) 2000-2002, Archaeopteryx Software, Inc.
Legal Statements