Skip to content

Server does not work well when multiple parallel calls by client #13

@impactaky

Description

@impactaky

With change client.ts as shown below and run,
I get an error about once every two times in my environment.

import { getClient } from "https://deno.land/x/grpc_basic@0.4.7/client.ts";
import { Greeter } from "./greeter.d.ts";

const protoPath = new URL("./greeter.proto", import.meta.url);
const protoFile = await Deno.readTextFile(protoPath);

const client = getClient<Greeter>({
  port: 50051,
  root: protoFile,
  serviceName: "Greeter",
});

/* unary calls */
await Promise.all([
  client.SayHello({ name: "unary #1" }),
  client.SayHello({ name: "unary #2" }),
]);

client.close();

Error message is

error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'slice')
      pair = entry.slice();
                   ^
    at HeaderSetDecompressor._execute (https://deno.land/x/grpc_basic@0.4.7/http2/hpack.ts:293:20)
    at _execute.next (<anonymous>)
    at Decompressor.decompress (https://deno.land/x/grpc_basic@0.4.7/http2/hpack.ts:1377:25)
    at GrpcClientImpl.readFrames (https://deno.land/x/grpc_basic@0.4.7/client.ts:240:31)
    at eventLoopTick (ext:core/01_core.js:183:11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions