[execnet-dev] Internal errors calling channel.send

holger krekel holger at merlinux.eu
Sat Aug 20 18:46:17 CEST 2011


On Fri, Aug 19, 2011 at 15:19 +0000, Shead, Timothy wrote:
> On Aug 18, 2011, at 2:05 AM, holger krekel wrote:
> 
> >> Sure 'nuff, here's a test case that always hangs in the same spot:
> >> 
> >> def stress_server(channel):
> >>  for request in channel:
> >>    channel.send(request)
> >> 
> >> gateway = execnet.makegateway("popen//python=jython")
> >> channel = gateway.remote_exec(stress_server)
> >> 
> >> for size in range(31):
> >>  sys.stderr.write("Sending string length %d\n" % 2**size)
> >>  original = "a" * (2**size)
> >>  channel.send(original)
> >>  response = channel.receive()
> >>  self.assertEqual(original, response)
> 
> 
> > Hi Timothy,
> > 
> > i presume this problem does not occur with CPython or PyPy versions, does it
> 
> Correct, this problem only manifests when using CPython <--> Jython.  If I test CPython <--> CPython, I'm able to pass huge amounts of data back-and-forth without problem.
> 
> > I wonder if Jython maybe has some problem with socket-sending/receiving code
> > or if there are race conditions between the receiving and sending thread
> > (Jython has free threading - the other python implementations do not).
> > 
> > Not sure i can help much but could you send the jython and java versions
> > you are using?
> 
> Sure, this is Jython running on an OSX 10.6 workstation, installed with MacPorts:
> 
> Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) 
> [Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_24

Could you maybe try to come up with an example where two threads concurrently
send/receive large data over a socket using Jython?  I suspect this will already
trigger the errors and would be something that could be pushed to the Jython
devs. Alternatively you could drop to the #jython channel and ask around there -
maybe it's a known problem anyway.

best,
holger

> Cheers,
> Tim
> 
> Timothy M. Shead
> Sandia National Laboratories
> 1461, Scalable Analysis and Visualization
> 



More information about the execnet-dev mailing list