NPE at com.excilys.ebi.gatling.core.result.RequestPath$.path

Hi again,
We are facing a strange NullPointerException in our scenario when we set up lots of users.

The scenario is:

val scn = scenario(name)
.exec(channel(channelName)

.open(url, “open”)
.serializable(classOf[Person])
.serializable(classOf[Counter]))
.repeat(5) {
exec(
channel(channelName)
.send(“hello”, “”, “send-and-wait-hello”)
.check(messageType.is(“hello”)))
.pause(scala.math.abs(random.nextInt(10)) milliseconds)
}
.exec(channel(channelName).close(“close”))

setUp(scn.users(300).ramp(1000 * 10 milliseconds)

And the exception we got is:

java.lang.NullPointerException
at com.excilys.ebi.gatling.core.result.RequestPath$.path(RequestPath.scala:41)
at com.excilys.ebi.gatling.core.result.writer.ConsoleDataWriter.onRequestRecord(ConsoleDataWriter.scala:112)
at com.excilys.ebi.gatling.core.result.writer.DataWriter$$anonfun$initialized$1.apply(DataWriter.scala:111)
at com.excilys.ebi.gatling.core.result.writer.DataWriter$$anonfun$initialized$1.apply(DataWriter.scala:106)
at akka.actor.Actor$class.apply(Actor.scala:318)
at com.excilys.ebi.gatling.core.result.writer.ConsoleDataWriter.apply(ConsoleDataWriter.scala:47)
at akka.actor.ActorCell.invoke(ActorCell.scala:626)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197)
at akka.dispatch.Mailbox.run(Mailbox.scala:179)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516)
at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259)
at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479)
at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

For some reason, sometimes, the “group” parameter of the path method is null (hence the NPE)… then this messes up the actor which was concerned by this NPE and this cannot restart properly anymore.
I spent time to debug but I have any idea how it does come that the “group” parameter can be null. Any idea / suggestion would be greatly appreciated!

We use:

  • Gatling 1.4.2 extended with our own protocol (as you may have guessed with the above scenario)
  • JDK 1.6.0_30
  • Scala 2.9.3
  • Ubuntu 12.10

Thanks in advance!

Hi,

Are you sure this NPE is the first one to occur? It looks to me that it’s actually the result of the actor crashing and losing its state.

Stéphane

Yes, it is the first exception that occures: all the following exception deal with the actor that restarts but with an invalid state.

Cheers.

2013/2/13 Stéphane Landelle <slandelle@excilys.com>

Apologizes!
We just found out that a callback was trying to call an actor with a user session that was already ended. Since the user session was ended, Gatling couldn’t find the associated requestPath…

Apologizes again.
Many thanks.

2013/2/14 ctranxuan ctranxuan <ctranxuan@gmail.com>

No problem, glad you could find it.

I’m actually refactoring this part: it’s a bit ugly, and getting a NPE is Scala is definitively something not to brag about…

Cheers,

Stéphane