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

RedisWorkerIO: NPE onAddressChanged #96

Closed
wants to merge 1 commit into from
Closed

Conversation

npeters
Copy link
Contributor

@npeters npeters commented Sep 28, 2015

if onAddressChanged is called before onConnected, onAddressChanged throw a NPE

[ERROR] [09/28/2015 08:02:50.751] [default-akka.actor.default-dispatcher-18] [akka://default/user/RedisClient-$h] null
java.lang.NullPointerException
at redis.actors.RedisWorkerIO.onAddressChanged(RedisWorkerIO.scala:98)
at redis.actors.RedisWorkerIO$$anonfun$connecting$1.applyOrElse(RedisWorkerIO.scala:55)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:170)
at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
at redis.actors.RedisWorkerIO.aroundReceive(RedisWorkerIO.scala:14)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

if  onAddressChanged is called before onConnected,  onAddressChanged throw a NPE

[ERROR] [09/28/2015 08:02:50.751] [default-akka.actor.default-dispatcher-18] [akka://default/user/RedisClient-$h] null
java.lang.NullPointerException
	at redis.actors.RedisWorkerIO.onAddressChanged(RedisWorkerIO.scala:98)
	at redis.actors.RedisWorkerIO$$anonfun$connecting$1.applyOrElse(RedisWorkerIO.scala:55)
	at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:170)
	at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
	at redis.actors.RedisWorkerIO.aroundReceive(RedisWorkerIO.scala:14)
	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
	at akka.actor.ActorCell.invoke(ActorCell.scala:487)
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
	at akka.dispatch.Mailbox.run(Mailbox.scala:220)
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
@etaty
Copy link
Owner

etaty commented Sep 28, 2015

Thanks.

Feel free to transform tcpWorker to a Option[ActorRef]
I think i was too optimistic, and the "one more feature" just ruined the stupid trick of tcpWorker = null

@npeters npeters closed this Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants