REPL lock-up handling UDP stream

32 views
Skip to first unread message

thenwithexpandedwingshesteershisflight

unread,
Jul 7, 2012, 9:03:46 AM7/7/12
to alep...@googlegroups.com
hi, I'm parsing a stream from the iphone app Sensor Data, which streams the iphone's sensor data over a port via UDP.

here's the code:

https://gist.github.com/3066388

it works, but the REPL is completely locking up sometimes (can't ctrl+d out) and I can't work out the why.

Zach Tellman

unread,
Jul 7, 2012, 3:57:04 PM7/7/12
to alep...@googlegroups.com
Nothing you're doing should be executing anything on the REPL thread,
so my guess is that maybe the data structure that is being printed is
just too large. Make sure you're only printing the count, and see if
the problem persists.

If it does, post a jstack dump of the REPL or swank process while it's hung.

Zach

thenwithexpandedwingshesteershisflight

unread,
Jul 7, 2012, 9:44:40 PM7/7/12
to alep...@googlegroups.com
it hangs in seemingly unrelated operations to Aleph/Lamina, even when the stream isn't being handled so maybe it's netty ?
Here's what I did:

lein repl
jps returns 2 processes for that repl

then I evaluated code here:
https://gist.github.com/3068925
- requiring a namespace, entering that namespace, creating channels, then I defined a function ready to receive-all on my channel (which has worked before), then it hung - jstacks for the 2 processes are below
- but that's not a reproducable scenario - I just tried the same again and no hang

Colin Jones

unread,
Jul 8, 2012, 9:21:58 PM7/8/12
to alep...@googlegroups.com
Which preview release of lein2 are you using? preview4 or earlier? There were some race-condition bugs fixed in REPLy after then that would definitely explain it, and the stacktrace line numbers in REPLy makes me suspect that you might be on preview4. 

Can you try upgrading lein2 to the latest preview, and see if you can still reproduce it?

- Colin

thenwithexpandedwingshesteershisflight

unread,
Jul 14, 2012, 4:06:11 AM7/14/12
to alep...@googlegroups.com
Leiningen 2.0.0-preview4 on Java 1.7.0_04 Java HotSpot(TM) 64-Bit Server VM

just upgraded to preview7 and no hanging - thanks!!

Zach Tellman

unread,
Jul 14, 2012, 2:17:12 PM7/14/12
to alep...@googlegroups.com
Glad to hear it. Colin, thanks for jumping in, I was completely at a loss.

Zach
Reply all
Reply to author
Forward
0 new messages