troubleshooting unresponsive pyro processes
Tom Smith <[email protected]>
| Newsgroups | gmane.comp.python.pyro |
|---|---|
| Message-ID | <CACkP893R_M9_d5eSvXQKQpakp=5+FLMdQoBQu12APF23J1duzA@mail.gmail.com> |
I recently learned about Pyro and am very excited about using it for a current project. However I have hit a roadblock. After some troubleshooting, here is my situation: My domain code works reliably if I execute it in the absence of Pyro. This code uses another library (C extension) that creates a worker thread. When I create an instance of my domain model and sit in a simple event loop, this part of the code works reliably (in particular, doing network I/O). My goal is to use Pyro to monitor/control aspects of the I/O performed by this code. When I augment this code to run inside a Pyro server process, things get flaky. (I am currently using the multiplex server in order to narrow down the possibilities.) Initial connections from a Pyro client may work fine, but within a few tries, both the client and server process will become unresponsive (cannot ^C). The pattern *seems* to be that this occurs after the domain class has done some network I/O, and then a Pyro client connects. (Connections from a Pyro client before the network I/O seem to work better, though maybe not 100%). I have tried looking at what the threads are doing via the technique shown at http://code.activestate.com/recipes/577334-how-to-debug-deadlocked-multi-threaded-programs/- however, the threads look OK: Pyro server thread: # ThreadID: 1078640640 File: "./migrate.py", line 162, in <module> main() File: "./migrate.py", line 155, in main daemon.requestLoop() File: "/usr/local/lib/python2.7/dist-packages/Pyro4/core.py", line 717, in requestLoop self.transportServer.loop(loopCondition=condition) File: "/usr/local/lib/python2.7/dist-packages/Pyro4/socketserver/multiplexserver.py", line 137, in loop polls=poll.poll(1000*Pyro4.config.POLLTIMEOUT) Pyro client thread: # ThreadID: 1074319360 File: "client.py", line 11, in <module> print simplePhone.getURI() File: "/usr/local/lib/python2.7/dist-packages/Pyro4/core.py", line 149, in __call__ return self.__send(self.__name, args, kwargs) File: "/usr/local/lib/python2.7/dist-packages/Pyro4/core.py", line 271, in _pyroInvoke self.__pyroCreateConnection() File: "/usr/local/lib/python2.7/dist-packages/Pyro4/core.py", line 334, in __pyroCreateConnection msgType, flags, seq, data = MessageFactory.getMessage(conn, None) File: "/usr/local/lib/python2.7/dist-packages/Pyro4/core.py", line 566, in getMessage headerdata = connection.recv(cls.HEADERSIZE) File: "/usr/local/lib/python2.7/dist-packages/Pyro4/socketutil.py", line 334, in recv return receiveData(self.sock, size) File: "/usr/local/lib/python2.7/dist-packages/Pyro4/socketutil.py", line 109, in receiveData data=sock.recv(size, socket.MSG_WAITALL) I have tried looking at a localhost packet capture, but wasn't able to make sense of the Pyro message exchanges (not surprising, but I was running out of ideas). I am using Pyro 4.17 on Linux. Any ideas on what I should try next? Many thanks, Tom ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 _______________________________________________ Pyro-core mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyro-core