Skip to content

http request with a keep-alive agent leads to an assertion failed error #13545

@unbornchikken

Description

@unbornchikken
  • Version: 8.0.0
  • Platform: Windows 10
  • Subsystem: http

I have an express application that uses http-proxy module. The proxy gets initialized with a custom http agent:

new http.Agent({ keepAlive: true })

http-proxy opens downstream with the standard http module, eg.:

var http   = require('http'),
    https  = require('https');

// ... stuff

var proxyReq = (options.target.protocol === 'https:' ? https : http).request(options));
// where options is { agent: new http.Agent({ keepAlive: true }) } 

See: https://github.com/nodejitsu/node-http-proxy/blob/master/lib/http-proxy/passes/web-incoming.js#L119

So there isn't any black magic, just standard node http with keep-alive configured. I worked with previous node versions but with 8.0.0 I get:

node.exe: c:\ws\src\env-inl.h:131: Assertion `(trigger_id) >= (0)' failed.

Error and of course node crashes.

https://github.com/nodejs/node/blob/master/src/env-inl.h#L131

Since those variables has recently been changed to double, maybe there is an overflow when keep alive gets enabled, that's why we get a failed positive check there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    async_hooksIssues and PRs related to the async hooks subsystem.duplicateIssues and PRs that are duplicates of other issues or PRs.httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions