-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Description
Version
v16.14.2
Platform
Linux host.ec2.internal 4.14.243-185.433.amzn2.x86_64 #1 SMP Mon Aug 9 05:55:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
http2 streams http tls
What steps will reproduce the bug?
Load up an HTTP2 server with SSL certificate. Perform requests, but don't complete them.
eg:
- disconnect before stream can be is read
- send bad SSL data
- disconnect between response can be written
After a while, ServerHttp2Session
, nghttp2_memory
, and Http2Session
vastly outnumber number of Http2ServerRequest
or Http2ServerResponse
references.
How often does it reproduce? Is there a required condition?
I believe it's from connection reset.
What is the expected behavior?
Objects should be cleared.
What do you see instead?
I have numerous memory snapshots and about 15 production servers exhibiting this issue. I can love dump a heapshot as needed. One shows the issue clearly with 102 ServerHttp2Session
objects, but only 18 Http2ServerRequest
objects.
TLSSocket
appears to clearly show that the references are internal. 21 out of 122 have a distance to window
. The rest appear to leak.
After rewriting code to eliminate all stream/session listeners to avoid leaking and only using getPipeline()
, I have a recent example of 40 sessions, 24 streams, and 21 req/res. The leaking ServerHttp2Session
look like this:
An active req/res (with middleware) looks like this:
Additional information
I have have more snapshots and can pull them. The HttpResponse
and HttpRequest
objects are custom middleware. The other 16 Http2ServerRequest
objects are mostly socket.io
objects, but they don't appear to leak. If you need the actual files, I'm on Slack and can share there (since snapshots have private information).