Re: PyRO Flame and Windows

Irmen de Jong <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 26-11-2012 15:54, Assaf wrote:
> Hi All,
> 
> 2 issues we have with the great FLAME feature.
> 
> 1. We run a flame server on a Windows host (2008 R2) and execute python code on a
> linux. from time to time the client just hangs, after several CTRL-C, re-runs it
> succeeds. Windows firewall was disabled. it seems like hanging in the line: 
> data=sock.recv(size, socket.MSG_WAITALL)

Hard to tell, but it looks like your server may have run out of threads in the Pyro
threadpool. Either try to increase the size of the threadpool by changing the
appropriate config item(s), or have less 'active' proxy objects in your client code.
Every 'active' proxy connection ties to one thread in the server's thread pool. If
there are no more threads available, Pyro4 will wait till one becomes available again,
before it continues processing new connections. You can 'help out' by releasing unused
proxy objects to free up threads again.

Alternatively, try to switch to the multiplexed server type rather than the default
threadpool server.

Failing all this, then we need a lot more information to be able to figure out what
the problem could be. Pyro4 doesn't have a known "hanging server" bug.

> 
> 2. How do I use the builtin 'open' with flame? For example, when using: fh =
> flame.builtin("open")(r'C:\\test.txt', 'r')
> 
> then, trying to readlines - it complains the file is closed

You can't do this: open file handles are not pickleable and cannot be sent across the
network like this. Unfortunately python doesn't always give a nice error that explains
what's going on, and this is one of the strange cases. Pickling a file object results
in an uninitialized file when it is unpickled again, rather than a PicklingError.

If you want very basic file transfer you could perhaps use Flame's builtin getfile()
method. Or make a Pyro object yourself that has a method to read the file on the
server, and that returns the file's contents rather than the open file handle.


Irmen


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Cygwin)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQs9eFAAoJEHC9o7RHFlf2xAQH/jHSpHCdcxIcny76YzGdWbx5
oPMMshS8DA6WEQ0Ivy6yl1VLdhZhurLBtsYcv9gVk1Nz1qnCceMsaPdo1DJ2ZMq1
5qUPCz69hNE1I5gLbRGl7ydsS2hURY2FuaMFe6r5HYGLaYg5QSpTSfF+zOiQhQ+E
tVH0yITJEkNNM3XIRE3z5MwYpNYYbxdmy2SQpQE432zCU1sqhJPngRiGnBM9mD0n
/Xry3HWHQwageMR9qENjyIDmZhQPnSpdMBF1kOXqRjupGnby7J2++qN6Ug4O5otF
LMuvMdJbfIxAAJudaFeDGyyoG7uW/wxGDJOK+DHDh89uCRw+2t33SM3BfG+gZxo=
=00O6
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.