Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in CanBindLocals / Local.isolate? #991

Closed
alexandru opened this issue Aug 27, 2019 · 6 comments

Comments

@alexandru
Copy link
Member

commented Aug 27, 2019

Shit, I think we have a problem in the latest release:

java.lang.NullPointerException
	at monix.execution.misc.CanBindLocals.isolate(CanBindLocals.scala:54)
	at monix.execution.misc.CanBindLocals.isolate$(CanBindLocals.scala:53)
	at monix.execution.misc.CanIsolateInstancesLevel0$SynchronousInstance$.isolate(CanBindLocals.scala:111)
	at monix.execution.misc.Local$.isolate(Local.scala:86)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:143)
	at monix.eval.internal.TaskRunLoop$.$anonfun$restartAsync$2(TaskRunLoop.scala:217)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at monix.execution.misc.CanIsolateInstancesLevel0$SynchronousInstance$.bindContext(CanBindLocals.scala:115)
	at monix.execution.misc.Local$.bind(Local.scala:94)
	at monix.eval.internal.TaskRunLoop$.$anonfun$restartAsync$1(TaskRunLoop.scala:215)
	at monix.execution.internal.InterceptableRunnable$Wrapped.run(InterceptableRunnable.scala:37)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

@alexandru alexandru added the bug label Aug 27, 2019

@alexandru

This comment has been minimized.

Copy link
Member Author

commented Aug 27, 2019

The bug seems to be thrown in:

  def isolate(f: => R): R =
    bindContext(Local.getContext().isolate())(f)
@alexandru

This comment has been minimized.

Copy link
Member Author

commented Aug 27, 2019

But that's not necessarily the source.

@cemelo

This comment has been minimized.

Copy link

commented Aug 29, 2019

I saw this bug. Using a TracingScheduler made it work for me.

@alexandru

This comment has been minimized.

Copy link
Member Author

commented Aug 30, 2019

@cemelo I've just released 3.0.0-RC5.

Can you please verify that it works, without the TracingScheduler?

@cemelo

This comment has been minimized.

Copy link

commented Aug 30, 2019

@alexandru Sure thing.

@cemelo

This comment has been minimized.

Copy link

commented Aug 30, 2019

@alexandru it worked! , although it seems the requirement to enable local context propagation is back? Without it I get a contract violation error, even when I use a TracingScheduler.

Edit: It was my mistake. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.