[Twisted-Python] Jelly assertion error when running client and server in the same process
pb_twisted at olga.mine.nu
Tue Aug 5 17:03:28 EDT 2003
I have a client and a server application communicating using Twisted and PB.
They run fine as separate programs.
When adding some unit tests, I try to run both the server and a client in
the same application, but I get an assertion error as shown below. I don't
really understand enough of what's happening under the Twisted hood to tell
from the message and looking at flavors.py what's causing the problem.
The applications are growing, so I made an attempt to make a minimal example
from scratch to demonstrate the problem. However, I failed to reproduce it
this way. Since stripping down the applications to a bare minimum can take
some time, I would first like to ask the list if anyone can give me an
indication of what could be the problem? Even with my bad etiquette of not
providing an example, someone is likely to have written that assert
statement for a reason.
Traceback (most recent call last):
File "C:\Python22\Lib\site-packages\twisted\internet\base.py", line 368,
File "E:\p\storskogen\src\skogen\common\Core.py", line 132, in
File "E:\p\storskogen\src\skogen\server\PlayerPerspective.py", line 65, in
File "C:\Python22\Lib\site-packages\twisted\spread\pb.py", line 323, in
return self.broker._sendMessage('',self.perspective, self.luid, name,
--- <exception caught here> ---
File "C:\Python22\Lib\site-packages\twisted\spread\pb.py", line 788, in
netArgs = self.serialize(args, perspective=perspective, method=message)
File "C:\Python22\Lib\site-packages\twisted\spread\pb.py", line 742, in
return jelly(object, self.security, None, self)
File "C:\Python22\Lib\site-packages\twisted\spread\jelly.py", line 845, in
return _Jellier(taster, persistentStore, invoker).jelly(object)
File "C:\Python22\Lib\site-packages\twisted\spread\jelly.py", line 451, in
File "C:\Python22\Lib\site-packages\twisted\spread\jelly.py", line 407, in
File "C:\Python22\Lib\site-packages\twisted\spread\flavors.py", line 434,
assert jellier.invoker is self.broker, "You cannot exchange cached
proxies between brokers."
exceptions.AssertionError: You cannot exchange cached proxies between
FWIW, I can say that the "self.remote.callRemote("addActor", actor)" line
belongs to the listener (server) side. Both peers make remote calls to each
other. The listener side has a number of Cacheable's and Cacheable's
containing Cacheable's, while the connecting side only exposes one
More information about the Twisted-Python