Skip to content

http2 (client): Error [ERR_HTTP2_INVALID_SESSION]: The session has been destroyed #14964

Description

@AndrewBarba
  • Version: Node.js 8.4.0
  • Platform: Heroku
  • Subsystem: Cedar-16 stack

I don't see this too often but once in a while it is showing up in my logs without a trace back to anything in my code. Below is a full class definition for a very basic http2-client library that I'm using to connect to Apple's HTTP/2 Push Notification API.

app/web.1: error:  Error [ERR_HTTP2_INVALID_SESSION]: The session has been destroyed 
app/web.1:     at ClientHttp2Session.shutdown (internal/http2/core.js:994:13) 
app/web.1:     at ClientHttp2Session.emitGoaway (internal/http2/core.js:377:10) 
app/web.1:     at _combinedTickCallback (internal/process/next_tick.js:131:7) 
app/web.1:     at process._tickDomainCallback (internal/process/next_tick.js:218:9) 
app/web.1: worker 1  disconnected. suicide false 

A couple things I could be doing incorrectly:

  1. I am only connecting once and holding onto returned client for subsequent requests
  2. I clean up the client only if .destroyed !== true or I receive a GOAWAY frame
  3. I am setting up a request timeout but not a session timeout (didn't see docs for session timeout?)

Code:
https://github.com/AndrewBarba/apns2/blob/node/http2/lib/http2-client.js

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    http2Issues and PRs related to the http2 subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions