speccy icon indicating copy to clipboard operation
speccy copied to clipboard

Hangs resolving external references with NodeJS >= 12.17.0

Open mgabeler-lee-6rs opened this issue 4 years ago • 3 comments

Detailed description

When running with NodeJS 12.17.0 or higher, speccy (esp. speccy lint) hangs when attempting to resolve external resources that come over HTTP/2.

Context

This renders speccy unusable by my team in our efforts to track NodeJS LTS releases.

I believe this is caused by https://github.com/hisco/http2-client/issues/26#issuecomment-644445967 -- not strictly speccy's fault, but speccy is dramatically affected.

Possible implementation

Not sure if speccy folks could help fix this issue in the underlying libraries, or adjust to a different HTTP/2 client library

Your environment

  • Node Version: 12.x (via nodenv)
  • Operating system and version: Linux (Debian) and macOS (various recent releases)

Demo file: note that the fact that the referenced URL is a 404 doesn't matter, because the nature of this bug is such that speccy and its dependencies never see the response anyways. It does matter that example.com serves HTTP/2.

openapi: 3.0.2
components:
  x:
    $ref: 'https://example.com/invalid.yaml'

Install node 12.17.0 or higher and just run npx speccy lint --verbose demo.yaml, or to see the full trace details, NODE_OPTIONS=--trace-tls NODE_DEBUG='*' npx speccy lint --verbose demo.yaml

mgabeler-lee-6rs avatar Jun 15 '20 23:06 mgabeler-lee-6rs

Addendum, root cause may be related to https://github.com/grantila/fetch-h2/issues/104 as well

mgabeler-lee-6rs avatar Jun 15 '20 23:06 mgabeler-lee-6rs

  1. Speccy is unmaintained
  2. Appears to be fixed in node 14.3.x so I would expect a back port to 12.x
  3. See https://github.com/Mermade/oas-kit/issues/223

MikeRalphson avatar Jun 16 '20 04:06 MikeRalphson

https://github.com/nodejs/node/pull/34859 should fix this for 12.x

mgabeler-lee-6rs avatar Aug 24 '20 15:08 mgabeler-lee-6rs