offbynull / coroutines

Java toolkit that allows you to write coroutines.
GNU Lesser General Public License v3.0
346 stars 53 forks source link

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

Closed forchid closed 6 years ago

forchid commented 6 years ago

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]

offbynull commented 6 years ago

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.

forchid commented 6 years ago

@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!

offbynull commented 6 years ago

I can try it shouldn't be difficult. Did it also fix #84 or is #84 still happening with 1.5.1?

On Thu, Aug 16, 2018, 11:25 PM Peter pan, notifications@github.com wrote:

@offbynull https://github.com/offbynull The issue has been fixed after coroutines library 1.4.0 upgraded to version 1.5.1.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/offbynull/coroutines/issues/85#issuecomment-413770236, or mute the thread https://github.com/notifications/unsubscribe-auth/AGD4IjXg4ZNEiYUObGYh-hwikWrxw_rmks5uRmHjgaJpZM4V_tba .

forchid commented 6 years ago

The issue #84 still is happening with coroutines 1.5.1.

offbynull commented 6 years ago

Let's get that resolved first and I'll backport this fix to 1.4.1.

Did you get a chance to look into my standalone program for #84? Were you able to modify it to replicate the issue?

I'm going to spend some more time today investigating #84.

On Fri, Aug 17, 2018, 4:26 AM Peter pan, notifications@github.com wrote:

the issue #84 https://github.com/offbynull/coroutines/issues/84 still is happening with coroutines 1.5.1.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/offbynull/coroutines/issues/85#issuecomment-413836509, or mute the thread https://github.com/notifications/unsubscribe-auth/AGD4IpRz-jp0g9MvC1q_UpP_hu7FRkrvks5uRqhpgaJpZM4V_tba .