offbynull/coroutines

What can cause the issue "saving not allowed at this point"?

Closed this issue · 5 comments

My github project co-nio uses the coroutines library.
Version information: coroutines-1.4.0, JDK 1.8, windows 8.1.

// io.conio.FactorialProxyHandler.java in CoProxyTest
FAILED TO INSTRUMENT: java.lang.IllegalStateException: [Ljava/net/InetSocketAddress;
19:49:40.003 [proxyGroup-nio] WARN io.conio.CoHandler - Calc error
java.lang.RuntimeException: Unexpected state (saving not allowed at this point)
at io.conio.CoGroup$CoFutureImpl.get(CoGroup.java) ~[classes/:na]
at io.conio.FactorialProxyHandler.doCalc(FactorialProxyHandler.java:38) ~[classes/:na]
at io.conio.FactorialServerHandler.calc(FactorialServerHandler.java:55) ~[classes/:na]
at io.conio.FactorialServerHandler.handle(FactorialServerHandler.java:26) ~[classes/:na]
at io.conio.PushCoChannel.run(PushCoChannel.java:27) [classes/:na]
at com.offbynull.coroutines.user.CoroutineRunner.execute(CoroutineRunner.java:65) [user-1.4.0.jar:na]
at io.conio.CoChannel.resume(CoChannel.java:65) [classes/:na]
at io.conio.CoGroup$NioGroup.handleAcception(CoGroup.java:491) [classes/:na]
at io.conio.CoGroup$NioGroup.run(CoGroup.java:415) [classes/:na]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]

There could be a couple of things going on here...

  1. I think this is related to issue #84: the coroutine state isn't being synchronized across the threads it's being used in.

  2. The following line in your output is an actual bug: FAILED TO INSTRUMENT: java.lang.IllegalStateException: [Ljava/net/InetSocketAddress; -- I've created a fix for it and pushed it into the repo. I'll cut a release soon.

If it's related to 2, it'll be fixed with the new release. If it's related to 1, it'll be fixed once we figure out what's happening with #84.

@offbynull The issue has been fixed after coroutines library 1.4.0 upgraded to version 1.5.1 in my project. Can you fix the bug in coroutine 1.4.x? Thank you!

The issue #84 still is happening with coroutines 1.5.1.