Issue1220

classification
Title: spiroserver.py on jython2.5b0 fails
Type: Severity: normal
Components: Core Versions: 2.5b0
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: amak, mlevalle
Priority: Keywords:

Created on 2009-01-07.23:06:23 by mlevalle, last changed 2009-03-24.15:22:57 by mlevalle.

Messages
msg4008 (view) Author: Michael A. LeValle (mlevalle) Date: 2009-01-07.23:06:21
Spiro is an open source tool that can be used to talk between cpython
and jython. (Available here: http://www.freenet.org.nz/python/spiro/)

It works in Jython 2.1, but fails when running as a server in Jython2.5b0

with

It works with Python 2.5 so I figure that it should work with Jython 2.5.
 (Seems to be a pickling issue)

spiro-0.1.0>jython spiroserver.py
2009-01-07 17:43:04 spiroserver.py:120:run():
* Listening for client requests on 127.0.0.1:9091

2009-01-07 17:44:49 spiroserver.py:188:handle():
* Got req from (u'127.0.0.1', 4781)

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': 'do', 'cacheId': None, 'kw': {}, 'args': (0,), 'cmdId': 0,
'cmd': 'ge
t'}

2009-01-07 17:44:49 spiroserver.py:324:executeRequest():
* get: seeking root attrib do

2009-01-07 17:44:49 spiroserver.py:555:sendReply():
* sending reply {'status': 'ok', 'val': None, 'cacheId': 0, 'type':
'reply', 'cm
dId': 0}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': None, 'cacheId': 0, 'kw': {}, 'args': ('import java',),
'cmdId': 1, '
cmd': 'call'}

2009-01-07 17:44:49 spiroserver.py:370:executeRequest():
* about to call object '<bound method SpiroSession.do of
<__main__.SpiroSession
instance at 11>>' with args=('import java',) kw={}

2009-01-07 17:44:49 spiroserver.py:451:do():
* Executing 'import java'

2009-01-07 17:44:49 spiroserver.py:380:executeRequest():
* back from call, allocated cacheId 1

2009-01-07 17:44:49 spiroserver.py:555:sendReply():
* sending reply {'status': 'ok', 'val': 'N.', 'cacheId': 1, 'type':
'reply', 'cm
dId': 1}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': None, 'cacheId': 1, 'kw': {}, 'args': (), 'cmdId': -1, 'cmd':
'goodby
e'}

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': 'java', 'cacheId': None, 'kw': {}, 'args': (0,), 'cmdId': 2,
'cmd': '
get'}

2009-01-07 17:44:49 spiroserver.py:324:executeRequest():
* get: seeking root attrib java

2009-01-07 17:44:49 spiroserver.py:329:executeRequest():
* get: about to eval 'java'

2009-01-07 17:44:49 spiroserver.py:332:executeRequest():
* get: got <java package java 19>

2009-01-07 17:44:49 spiroserver.py:555:sendReply():
* sending reply {'status': 'ok', 'val': None, 'cacheId': 2, 'type':
'reply', 'cm
dId': 2}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': 'lang', 'cacheId': 2, 'kw': {}, 'args': (0,), 'cmdId': 3,
'cmd': 'get
'}

2009-01-07 17:44:49 spiroserver.py:276:executeRequest():
* found item 2 in cache, fetching attrib lang

2009-01-07 17:44:49 spiroserver.py:293:executeRequest():
* about to reply

2009-01-07 17:44:49 spiroserver.py:555:sendReply():
* sending reply {'status': 'ok', 'val': None, 'cacheId': 3, 'type':
'reply', 'cm
dId': 3}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': 'Math', 'cacheId': 3, 'kw': {}, 'args': (0,), 'cmdId': 4,
'cmd': 'get
'}

2009-01-07 17:44:49 spiroserver.py:276:executeRequest():
* found item 3 in cache, fetching attrib Math

2009-01-07 17:44:49 spiroserver.py:293:executeRequest():
* about to reply

2009-01-07 17:44:49 spiroserver.py:555:sendReply():
* sending reply {'status': 'ok', 'val': None, 'cacheId': 4, 'type':
'reply', 'cm
dId': 4}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': 'sqrt', 'cacheId': 4, 'kw': {}, 'args': (0,), 'cmdId': 5,
'cmd': 'get
'}

2009-01-07 17:44:49 spiroserver.py:276:executeRequest():
* found item 4 in cache, fetching attrib sqrt

2009-01-07 17:44:49 spiroserver.py:293:executeRequest():
* about to reply

2009-01-07 17:44:49 spiroserver.py:555:sendReply():
* sending reply {'status': 'ok', 'val': None, 'cacheId': 5, 'type':
'reply', 'cm
dId': 5}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': '__str__', 'cacheId': 5, 'kw': {}, 'args': (0,), 'cmdId': 6,
'cmd': '
get'}

2009-01-07 17:44:49 spiroserver.py:276:executeRequest():
* found item 5 in cache, fetching attrib __str__

2009-01-07 17:44:49 spiroserver.py:293:executeRequest():
* about to reply

2009-01-07 17:44:49 spiroserver.py:555:sendReply():
* sending reply {'status': 'ok', 'val': None, 'cacheId': 6, 'type':
'reply', 'cm
dId': 6}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': None, 'cacheId': 6, 'kw': {}, 'args': (), 'cmdId': 7, 'cmd':
'call'}

2009-01-07 17:44:49 spiroserver.py:370:executeRequest():
* about to call object '<function _thefunc at 47>' with args=() kw={}

2009-01-07 17:44:49 spiroserver.py:380:executeRequest():
* back from call, allocated cacheId 7

2009-01-07 17:44:49 spiroserver.py:555:sendReply():
* sending reply {'status': 'ok', 'val': "S'<java function sqrt
40>'\np0\n.", 'ca
cheId': 7, 'type': 'reply', 'cmdId': 7}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': None, 'cacheId': 7, 'kw': {}, 'args': (), 'cmdId': -1, 'cmd':
'goodby
e'}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': None, 'cacheId': 5, 'kw': {}, 'args': (16,), 'cmdId': 8,
'cmd': 'call
'}

2009-01-07 17:44:49 spiroserver.py:370:executeRequest():
* about to call object '<java function sqrt 40>' with args=(16,) kw={}

2009-01-07 17:44:49 spiroserver.py:380:executeRequest():
* back from call, allocated cacheId 8

2009-01-07 17:44:49 spiroserver.py:555:sendReply():
* sending reply {'status': 'ok', 'val': 'F4.0\n.', 'cacheId': 8, 'type':
'reply'
, 'cmdId': 8}

2009-01-07 17:44:49 spiroserver.py:607:__init__():
* creating SpiroUnpickler

2009-01-07 17:44:49 spiroserver.py:249:executeRequest():
* {'attr': None, 'cacheId': 8, 'kw': {}, 'args': (), 'cmdId': -1, 'cmd':
'goodby
e'}

2009-01-07 17:44:49 spiroserver.py:224:getRequest():
* Traceback (most recent call last):
   +   File "spiroserver.py", line 222, in getRequest
   +     size = int(self.rfile.readline().strip())
   +   File "C:\DEV\jython2.5b0\Lib\socket.py", line 1276, in readline
   +     data = self._sock.recv(self._rbufsize)
   +   File "C:\DEV\jython2.5b0\Lib\socket.py", line 817, in recv
   +     raise _map_exception(jlx)
   + error: (104, 'Software caused connection abort')
   +
   + Failed to read size header, killing client

2009-01-07 17:44:49 spiroserver.py:194:handle():
* Traceback (most recent call last):
   +   File "spiroserver.py", line 192, in handle
   +     req = self.getRequest()
   +   File "spiroserver.py", line 225, in getRequest
   +     thread.exit()
   + SystemExit: 0
   +
   + Failed to get request

2009-01-07 17:44:49 spiroserver.py:130:finish_request():
* Client session terminated
msg4012 (view) Author: Alan Kennedy (amak) Date: 2009-01-08.13:10:37
I remember when Spiro was created, mainly because jython could not run
pyro at that time.

But spiro has not been maintained for almost 5 years, and never got past
0.10 alpha stage.

Whereas Pyro has made strides, and there have been successful reports of
running server-side pyro on jython, now that we have a select module.

http://www.razorvine.net/python/PyroAndJython

I highly recommed giving pyro another try.
msg4344 (view) Author: Michael A. LeValle (mlevalle) Date: 2009-03-23.19:53:26
The issue is that this works with Python 2.5 but not with Jython 2.5.
Has it been resolved why? Isn't this a bug in Jython 2.5? (Regardless of
whether Spiro is a recommended tool for distributed programming)
msg4345 (view) Author: Alan Kennedy (amak) Date: 2009-03-23.23:04:26
If you can provide a snippet of code that illustrates a bug, the bug
will be fixed.

I don't think any of the jython development team have the time to spend
debugging an alpha piece of software that the original author abandoned
five years ago.
msg4346 (view) Author: Michael A. LeValle (mlevalle) Date: 2009-03-24.15:22:57
That makes sense. I'm curious as to why it works with previous versions
of Jython and previous and current versions of Python but not Jython
2.5. I'll take a look over the weekend and see if I can find something
useful. (It may turn out to be a known "issue" that's reported in Pyro /
Jython usage.)
History
Date User Action Args
2009-03-24 15:22:57mlevallesetmessages: + msg4346
2009-03-23 23:04:27amaksetmessages: + msg4345
2009-03-23 19:53:26mlevallesetmessages: + msg4344
2009-01-24 20:25:26cgrovessetstatus: open -> closed
resolution: invalid
2009-01-08 13:10:37amaksetnosy: + amak
messages: + msg4012
2009-01-07 23:06:23mlevallecreate