Skip to content

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

Closed

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.

Activity

  1. added
    async_hooks
    duplicate
    http
    on Jun 8, 2017
  2. addaleax commented on Jun 8, 2017

    @addaleax
    Member

    Hi, thanks for reporting this issue!

    This has been fixed by #13348 (which is going out with the 8.1.0 release today) / is very very likely a duplicate of #13325, so I’ll be closing this, but feel free to ask any follow-up questions you may have.

  3. addaleax commented on Jun 8, 2017

    @addaleax
    Member

    @unbornchikken Actually, 8.1.0 was just released; feel free to try and verify that this is fixed now.

  4. unbornchikken commented on Jun 8, 2017

    @unbornchikken
    Author

    Fixed, thanks.

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

    async_hooksduplicatehttp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions