Unhandled message in DataWriter

I’m modifying a websockets plugin for Gatling 1.5.2, and an integration test has uncovered the stack trace that follows below. It’s puzzling because the message is generated by core Gatling code, which it is not able to handle itself. Are there any suggestions on how to fix this? Can I disable the DataWriters entirely for integration testing using the GatlingConfiguration? I don’t see an obvious way to do this.

Stack trace:

ERROR] [10/02/2013 09:43:20.750] [main] [akka://GatlingSystem/user/$b] Actor ConsoleDataWriter doesn’t support message RequestRecord(test session,1,OpenWebSocketAction,1380732200721,1380732200729,1380732200729,1380732200729,KO,Some(WebSocket method must be a GET),List())
java.lang.IllegalArgumentException: Actor ConsoleDataWriter doesn’t support message RequestRecord(test session,1,OpenWebSocketAction,1380732200721,1380732200729,1380732200729,1380732200729,KO,Some(WebSocket method must be a GET),List())
at com.excilys.ebi.gatling.core.action.BaseActor$class.unhandled(BaseActor.scala:28)
at com.excilys.ebi.gatling.core.result.writer.ConsoleDataWriter.unhandled(ConsoleDataWriter.scala:45)
at akka.actor.Actor$class.apply(Actor.scala:318)
at com.excilys.ebi.gatling.core.result.writer.ConsoleDataWriter.apply(ConsoleDataWriter.scala:45)
at akka.actor.ActorCell.invoke(ActorCell.scala:626)
at akka.testkit.CallingThreadDispatcher.runQueue(CallingThreadDispatcher.scala:235)
at akka.testkit.CallingThreadDispatcher.dispatch(CallingThreadDispatcher.scala:201)
at akka.actor.ActorCell.tell(ActorCell.scala:475)
at akka.actor.LocalActorRef.$bang(ActorRef.scala:328)
at com.excilys.ebi.gatling.core.result.writer.DataWriter$$anonfun$tellAll$1.apply(DataWriter.scala:41)
at com.excilys.ebi.gatling.core.result.writer.DataWriter$$anonfun$tellAll$1.apply(DataWriter.scala:41)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:72)
at com.excilys.ebi.gatling.core.result.writer.DataWriter$.tellAll(DataWriter.scala:41)
at com.excilys.ebi.gatling.core.result.writer.DataWriter$.logRequest(DataWriter.scala:72)
at com.jivesoftware.gatling.websocket.RequestLogger$class.logRequest(Logging.scala:11)
at com.jivesoftware.gatling.websocket.WebSocketActor.logRequest(Actors.scala:17)
at com.jivesoftware.gatling.websocket.WebSocketActor$$anonfun$receive$1.apply(Actors.scala:40)
at com.jivesoftware.gatling.websocket.WebSocketActor$$anonfun$receive$1.apply(Actors.scala:32)
at akka.actor.Actor$class.apply(Actor.scala:318)
at com.jivesoftware.gatling.websocket.WebSocketActor.apply(Actors.scala:17)
at akka.actor.ActorCell.invoke(ActorCell.scala:626)
at akka.testkit.CallingThreadDispatcher.runQueue(CallingThreadDispatcher.scala:235)
at akka.testkit.CallingThreadDispatcher.dispatch(CallingThreadDispatcher.scala:201)
at akka.actor.ActorCell.tell(ActorCell.scala:475)
at akka.actor.LocalActorRef.$bang(ActorRef.scala:328)
at com.jivesoftware.gatling.websocket.open.OpenWebSocketAction.execute(Open.scala:82)
at com.excilys.ebi.gatling.core.action.Action$$anonfun$receive$1.apply(Action.scala:31)
at com.excilys.ebi.gatling.core.action.Action$$anonfun$receive$1.apply(Action.scala:30)
at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:76)
at akka.actor.Actor$class.apply(Actor.scala:318)
at com.jivesoftware.gatling.websocket.open.OpenWebSocketAction.apply(Open.scala:62)
at akka.actor.ActorCell.invoke(ActorCell.scala:626)
at akka.testkit.CallingThreadDispatcher.runQueue(CallingThreadDispatcher.scala:235)
at akka.testkit.CallingThreadDispatcher.dispatch(CallingThreadDispatcher.scala:201)
at akka.actor.ActorCell.tell(ActorCell.scala:475)
at akka.actor.LocalActorRef.$bang(ActorRef.scala:328)
at com.jivesoftware.gatling.websocket.open.OpenSocketIOConnectionSpec$$anonfun$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(OpenConnectionSpec.scala:50)
at com.jivesoftware.gatling.websocket.open.OpenSocketIOConnectionSpec$$anonfun$1$$anonfun$apply$mcV$sp$1.apply(OpenConnectionSpec.scala:28)
at com.jivesoftware.gatling.websocket.open.OpenSocketIOConnectionSpec$$anonfun$1$$anonfun$apply$mcV$sp$1.apply(OpenConnectionSpec.scala:28)
at org.scalatest.FunSpecLike$$anon$1.apply(FunSpecLike.scala:387)

Relevant code paths are as follows:

trait DataWriter extends BaseActor {

def initialized: Receive = {

case requestRecord: RequestRecord => onRequestRecord(requestRecord)
}
}

It’s really puzzling to me why the DataWriter would be unable to handle a RequestRecord, but I’m spit out to this path:

trait BaseActor extends Actor with AkkaDefaults with ClassSimpleNameToString with Logging {

override def unhandled(message: Any) {
message match {
case Terminated(dead) => super.unhandled(message)
case unknown => throw new IllegalArgumentException("Actor " + this + " doesn’t support message " + unknown)
}
}
}

Hi Randall,

First of all, please note that Andrew’s websockets plugin has made it into Gatling’s master (IIRC, cookie support is still missing), so you could use a snapshot hosted on Cloudbees. And if you’re willing to put some effort in this, I’d rather have you contribute to the official websocket support :wink:

Akka Actors can act as Final State Machines. The message you get simply means that ConsoleDataWriter is in a state where it cannot handle RequestRecord: either wasn’t properly initialized, or crashed and returned to uninitialized state (which is very unlikely as of ConsoleDataWriter’s lack of complexity).
Difficult to know without actually running your code.

Could you give master a try, please?

Cheers,

Stéphane

Thanks, Stephane. I didn’t realize that it was wrapped up into the core code base. I’ll give it a look. The functionality I’m trying to extend is for Socket.io, which has a protocol different than raw websockets. Would this be addressed with the latest additions to 2.x?

Interesting.
Sorry, no plans for Socket.io support at this time: hands are full. But contributions welcome :wink:
If you can publish your code and build a test case, I could have a look though.

Working on it … it’s still half-baked, but getting there. I’ll be contributing it as randall-jive.

Would be great!
Which Socket.io do you use?

We’ve got a bunch of functionality built up around Socket.io + Node.js, but using Gatling in a portion of our test harness.