Skip to content

@grpc/grpc-js: Closing Stream After Unary Call Triggers Double Free #1464

Closed
@moloch--

Description

Problem description

Attempting to close the client's connections to a server after making a single unary call triggers a panic in Node (this may actually be a bug in Node, it's not clear to me).

Reproduction steps

I have a client class that manages a couple gRPC streams (_events and _tunnelStream) that are open for the lifetime of the client class. The client also makes unary calls. After making any number of unary calls (1 or more), and attempting to disconnect with the function below triggers a double free what appears to be the NodeJS HTTP/2 library:

  async disconnect(): Promise<void> {
    if (this._events !== null) {
      this._events.on('error', () => {})
      this._events.cancel()
    }
    if (this._tunnelStream !== null) {
      this._tunnelStream.on('error', () => {})
      this._tunnelStream.cancel()
    }
    this.rpc.close()
  }

Environment

  • MacOS / Ubuntu 20.04
  • Node version 14
  • Package name and version @grpc/grpc-js ^1.0.3

Screenshots

Screen Shot 2020-06-07 at 10 59 01 AM

Screen Shot 2020-06-07 at 8 18 13 AM

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions