tester11203
tester11203

Reputation: 1

RST_STREAM closed stream unexpectedly in Gatling-grpc

Note: using this Gatling community plugin for gRPC, not the official one.

I have a sample code to setup a single UNARY grpc call in Gatling as below:

class grpcDemo extends Simulation {

  val grpcConf = grpc(managedChannelBuilder(target = s"grpcbin.test.k6.io:9000").usePlaintext())
                    .disableWarmUp
  val demoMessage = (session: io.gatling.core.session.Session) => {
    HelloRequest(
        greeting = Option[String]("name")
    )
  }
  val grpcCallDefine = grpc("Unary")
        .rpc(HelloServiceGrpc.METHOD_SAY_HELLO)
        .payload(demoMessage)
        .check(statusCode is Status.Code.OK)

  val scn = scenario("BasicSimulation") 
        .exec(grpcCallDefine)

  setUp(
    scn.inject(atOnceUsers(1))
  ).protocols(grpcConf)
}

Here is my protobuf file, taken from k6 grpc endpoint grpcbin.test.k6.io:

syntax = "proto2";

package hello;

service HelloService {
  rpc SayHello(HelloRequest) returns (HelloResponse);
  rpc LotsOfReplies(HelloRequest) returns (stream HelloResponse);
  rpc LotsOfGreetings(stream HelloRequest) returns (HelloResponse);
  rpc BidiHello(stream HelloRequest) returns (stream HelloResponse);
}

message HelloRequest {
  optional string greeting = 1;
}

message HelloResponse {
  required string reply = 1;
}

Run a simple test, I then got this weird error:

Session:
Session(BasicSimulation,1,Map(gatling.grpc.channel -> ManagedChannelOrphanWrapper{delegate=ManagedChannelImpl{logId=1, target=grpcbin.test.k6.io:9000}}),OK,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$442/0x000000900145fc20@2f066478,io.netty.channel.nio.NioEventLoop@706a757e)
=========================
gRPC request:
headers=
grpc-accept-encoding: gzip
payload=
greeting: "name"

=========================
gRPC response:
status=
UNAVAILABLE, description: RST_STREAM closed stream. HTTP/2 error code: NO_ERROR

What could be causing this behavior?

Tested the same endpoint with Postman, it worked. Not sure why Gatling-grpc would fail.

Edit: As I add in a repeat(2), Gatling will be hanging and the 2nd request will not be executed.

Upvotes: 0

Views: 169

Answers (0)

Related Questions