function onHttp2SessionGoAway (errorCode) {
  // TODO(mcollina): Verify if GOAWAY implements the spec correctly:
  // https://datatracker.ietf.org/doc/html/rfc7540#section-6.8
  // Specifically, we do not verify the "valid" stream id.

  const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${errorCode}`, util.getSocketInfo(this[kSocket]))
  const client = this[kClient]

  client[kSocket] = null
  client[kHTTPContext] = null

  // this is an HTTP2 session
  this.close()
  this[kHTTP2Session] = null

  util.destroy(this[kSocket], err)

  // Fail head of pipeline.
  if (client[kRunningIdx] < client[kQueue].length) {
    const request = client[kQueue][client[kRunningIdx]]
    client[kQueue][client[kRunningIdx]++] = null
    util.errorRequest(client, request, err)
    client[kPendingIdx] = client[kRunningIdx]
  }

  assert(client[kRunning] === 0)

  client.emit('disconnect', client[kUrl], [client], err)
  client.emit('connectionError', client[kUrl], [client], err)

  client[kResume]()
}
This is the root cause of #3011
We need to handle GOAWAY frames properly, and trigger the session close
along with the socket right away

@this {import('http2').ClientHttp2Session}
@param {number} errorCode