Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPParser reuse causes confusing contexts. #1

Open
RobinQu opened this issue Sep 7, 2016 · 4 comments
Open

HTTPParser reuse causes confusing contexts. #1

RobinQu opened this issue Sep 7, 2016 · 4 comments

Comments

@RobinQu
Copy link
Owner

RobinQu commented Sep 7, 2016

Failing test case: https://github.com/RobinQu/async-zone/blob/master/test/http_test.js#L70

My guess:

  • request callback is bound to HTTPParser
  • HTTPParser's init hook is only called the first time it's created and not called after reuse.
  • the context bound to that HTTPParser is not changed since the creation, thus all async callbacks associated to HTTPParser are run in an incorrect zone.

Run with DEBUG

$ DEBUG=async-zone npm test

> async-zone@1.0.0 test /Users/robinqu/Desktop/Repos/async-zone
> mocha
init NextTickWrap -2 Zone { name: 'root', parent: undefined, context: {} } null null
init Signal 4 Zone { name: 'root', parent: undefined, context: {} } null null
--> NextTickWrap -1
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -1 false { name: 'root', parent: undefined, context: {} } null null
--> NextTickWrap -2
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -2 false
init TCP 6 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -3 Zone { name: 'root', parent: undefined, context: {} } null null
--> NextTickWrap -3
enter Zone { name: 'root', parent: undefined, context: {} }
init TCP 7 Zone { name: 'root', parent: undefined, context: {} } null null
init GetAddrInfoReqWrap 8 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -4 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -3 false
--> NextTickWrap -4
enter Zone { name: 'root', parent: undefined, context: {} }
init HTTPParser 9 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -5 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -4 false
--> NextTickWrap -5
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -5 false
--> GetAddrInfoReqWrap 8
enter Zone { name: 'root', parent: undefined, context: {} }
init TCPConnectWrap 10 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- GetAddrInfoReqWrap 8 false
--> TCPConnectWrap 10
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- TCPConnectWrap 10 false
init TCP 11 Zone {
  name: undefined,
  parent: Zone { name: 'root', parent: undefined, context: {} },
  context: {} } TCP {
  bytesRead: 0,
  _externalStream: {},
  fd: 13,
  reading: false,
  owner: 
   Server {
     domain: null,
     _events: 
      { request: [Function],
        connection: [Function: connectionListener],
        clientError: [Function] },
     _eventsCount: 3,
     _maxListeners: undefined,
     _connections: 0,
     _handle: [Circular],
     _usingSlaves: false,
     _slaves: [],
     _unref: false,
     allowHalfOpen: true,
     pauseOnConnect: false,
     httpAllowHalfOpen: false,
     timeout: 120000,
     _pendingResponseData: 0,
     _connectionKey: '6::::0' },
  onread: null,
  onconnection: [Function: onconnection],
  writeQueueSize: 0 } 6
--> TCP 6
enter Zone { name: 'root', parent: undefined, context: {} }
init HTTPParser 13 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -6 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- TCP 6 false
--> NextTickWrap -6
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -6 false
--> HTTPParser 13
enter Zone { name: 'root', parent: undefined, context: {} }
enter Zone { name: '', parent: undefined, context: {} }
init NextTickWrap -7 Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: false,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: false,
        _dumped: false },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: false,
        _headerSent: true,
        socket: [Object],
        connection: [Object],
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } } null null
init NextTickWrap -8 Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: false,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: false,
        _dumped: false },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: false,
        _headerSent: true,
        socket: [Object],
        connection: [Object],
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } } null null
exit Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: false,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: false,
        _dumped: false },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Object],
        connection: [Object],
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- HTTPParser 13 false
--> HTTPParser 13
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -9 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- HTTPParser 13 false
--> HTTPParser 13
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- HTTPParser 13 false
--> NextTickWrap -7
enter Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: false,
        _dumped: false },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Object],
        connection: [Object],
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
init NextTickWrap -10 Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: false,
        _dumped: true },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Object],
        connection: [Object],
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } } null null
exit Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: false,
        _dumped: true },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
<-- NextTickWrap -7 false
--> NextTickWrap -8
enter Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: false,
        _dumped: true },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
init ShutdownWrap 14 Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: false,
        _dumped: true },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } } null null
exit Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: false,
        _dumped: true },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
<-- NextTickWrap -8 false
--> NextTickWrap -9
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -11 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -9 false
--> NextTickWrap -10
enter Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
init NextTickWrap -12 Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } } null null
init NextTickWrap -13 Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } } null null
init NextTickWrap -14 Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } } null null
exit Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
<-- NextTickWrap -10 false
--> NextTickWrap -11
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -11 false
--> NextTickWrap -12
enter Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: false,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
exit Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: false,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
<-- NextTickWrap -12 false
--> NextTickWrap -13
enter Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: false,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
exit Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: false,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
<-- NextTickWrap -13 false
--> NextTickWrap -14
enter Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: false,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
exit Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: false,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
<-- NextTickWrap -14 false
--> ShutdownWrap 14
enter Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: false,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
exit Zone {
  name: '',
  parent: undefined,
  context: 
   { req: 
      IncomingMessage {
        _readableState: [Object],
        readable: false,
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        socket: [Object],
        connection: [Object],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Object],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '/path1',
        method: 'GET',
        statusCode: null,
        statusMessage: null,
        client: [Object],
        _consuming: true,
        _dumped: true,
        read: [Function] },
     res: 
      ServerResponse {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _removedHeader: {},
        _contentLength: 18,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: null,
        connection: null,
        _header: 'HTTP/1.1 200 OK\r\nDate: Wed, 07 Sep 2016 08:00:12 GMT\r\nConnection: close\r\nContent-Length: 18\r\n\r\n',
        _headers: null,
        _headerNames: {},
        _onPendingData: [Function: updateOutgoingData],
        statusMessage: 'OK',
        statusCode: 200 } } }
<-- ShutdownWrap 14 false
--> TCP 11
enter Zone {
  name: undefined,
  parent: Zone { name: 'root', parent: undefined, context: {} },
  context: {} }
exit Zone {
  name: undefined,
  parent: Zone { name: 'root', parent: undefined, context: {} },
  context: {} }
<-- TCP 11 false
--> TCP 7
enter Zone { name: 'root', parent: undefined, context: {} }
----> HTTPParser 9
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -15 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<---- HTTPParser 9 false
----> HTTPParser 9
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -16 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<---- HTTPParser 9 false
----> HTTPParser 9
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<---- HTTPParser 9 false
init NextTickWrap -17 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- TCP 7 false
--> NextTickWrap -15
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -15 false
--> NextTickWrap -16
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -18 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -16 false
--> NextTickWrap -17
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -17 false
--> NextTickWrap -18
enter Zone { name: 'root', parent: undefined, context: {} }
init ShutdownWrap 15 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -19 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -18 false
--> NextTickWrap -19
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -19 false
--> ShutdownWrap 15
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- ShutdownWrap 15 false
--> TCP 7
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- TCP 7 false
init TCP 17 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -20 Zone { name: 'root', parent: undefined, context: {} } null null
--> NextTickWrap -20
enter Zone { name: 'root', parent: undefined, context: {} }
enter Zone { name: '', parent: undefined, context: {} }
init TCP 18 Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } } null null
init GetAddrInfoReqWrap 19 Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } } null null
init NextTickWrap -21 Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } } null null
exit Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -20 false
--> NextTickWrap -21
enter Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
init NextTickWrap -22 Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } } null null
exit Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
<-- NextTickWrap -21 false
--> NextTickWrap -22
enter Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
exit Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
<-- NextTickWrap -22 false
--> GetAddrInfoReqWrap 19
enter Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
init TCPConnectWrap 20 Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } } null null
exit Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
<-- GetAddrInfoReqWrap 19 false
init TCP 21 Zone {
  name: undefined,
  parent: Zone { name: 'root', parent: undefined, context: {} },
  context: {} } TCP {
  bytesRead: 0,
  _externalStream: {},
  fd: 13,
  reading: false,
  owner: 
   Server {
     domain: null,
     _events: 
      { request: [Function],
        connection: [Function: connectionListener],
        clientError: [Function] },
     _eventsCount: 3,
     _maxListeners: undefined,
     _connections: 0,
     _handle: [Circular],
     _usingSlaves: false,
     _slaves: [],
     _unref: false,
     allowHalfOpen: true,
     pauseOnConnect: false,
     httpAllowHalfOpen: false,
     timeout: 120000,
     _pendingResponseData: 0,
     _connectionKey: '6::::0' },
  onread: null,
  onconnection: [Function: onconnection],
  writeQueueSize: 0 } 17
--> TCP 17
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -23 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- TCP 17 false
--> NextTickWrap -23
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -23 false
--> TCPConnectWrap 20
enter Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
exit Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
<-- TCPConnectWrap 20 false
--> HTTPParser 13
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -24 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -25 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- HTTPParser 13 false
--> HTTPParser 13
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -26 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- HTTPParser 13 false
--> HTTPParser 13
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- HTTPParser 13 false
--> NextTickWrap -24
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -27 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -24 false
--> NextTickWrap -25
enter Zone { name: 'root', parent: undefined, context: {} }
init ShutdownWrap 22 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -25 false
--> NextTickWrap -26
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -28 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -26 false
--> NextTickWrap -27
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -29 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -30 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -31 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -27 false
--> NextTickWrap -28
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -28 false
--> NextTickWrap -29
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -29 false
--> NextTickWrap -30
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -30 false
--> NextTickWrap -31
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -31 false
--> ShutdownWrap 22
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- ShutdownWrap 22 false
--> TCP 21
enter Zone {
  name: undefined,
  parent: Zone { name: 'root', parent: undefined, context: {} },
  context: {} }
exit Zone {
  name: undefined,
  parent: Zone { name: 'root', parent: undefined, context: {} },
  context: {} }
<-- TCP 21 false
--> TCP 18
enter Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
----> HTTPParser 9
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -32 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<---- HTTPParser 9 false
----> HTTPParser 9
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -33 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<---- HTTPParser 9 false
----> HTTPParser 9
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<---- HTTPParser 9 false
init NextTickWrap -34 Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } } null null
exit Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
<-- TCP 18 false
--> NextTickWrap -32
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -32 false
--> NextTickWrap -33
enter Zone { name: 'root', parent: undefined, context: {} }
init NextTickWrap -35 Zone { name: 'root', parent: undefined, context: {} } null null
********hello!!!! 0.1311545476783067
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -33 true
init ImmediateWrap -36 Zone { name: 'root', parent: undefined, context: {} } null null
--> ImmediateWrap -36
enter Zone { name: 'root', parent: undefined, context: {} }
----> NextTickWrap -34
enter Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
exit Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
<---- NextTickWrap -34 false
----> NextTickWrap -35
enter Zone { name: 'root', parent: undefined, context: {} }
init ShutdownWrap 23 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -37 Zone { name: 'root', parent: undefined, context: {} } null null
exit Zone { name: 'root', parent: undefined, context: {} }
<---- NextTickWrap -35 false
----> NextTickWrap -37
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<---- NextTickWrap -37 false
exit Zone { name: 'root', parent: undefined, context: {} }
<-- ImmediateWrap -36 false
--> ShutdownWrap 23
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- ShutdownWrap 23 false
--> TCP 18
enter Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
exit Zone {
  name: '',
  parent: undefined,
  context: { secret: 0.2395219726022333 } }
<-- TCP 18 false

init NextTickWrap -38 Zone { name: 'root', parent: undefined, context: {} } null null
  2 passing (102ms)
init NextTickWrap -39 Zone { name: 'root', parent: undefined, context: {} } null null
  1 failing
init NextTickWrap -40 Zone { name: 'root', parent: undefined, context: {} } null null

init NextTickWrap -41 Zone { name: 'root', parent: undefined, context: {} } null null
  1) http Client should work with http.request:
     Uncaught AssertionError: expected undefined to equal 0.2395219726022333
      at IncomingMessage.<anonymous> (test/http_test.js:89:53)
      at emitReadable_ (_stream_readable.js:419:10)

init NextTickWrap -42 Zone { name: 'root', parent: undefined, context: {} } null null

init NextTickWrap -43 Zone { name: 'root', parent: undefined, context: {} } null null

init NextTickWrap -44 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -45 Zone { name: 'root', parent: undefined, context: {} } null null
init NextTickWrap -46 Zone { name: 'root', parent: undefined, context: {} } null null
--> NextTickWrap -38
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -38 false
--> NextTickWrap -39
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -39 false
--> NextTickWrap -40
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -40 false
--> NextTickWrap -41
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -41 false
--> NextTickWrap -42
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -42 false
--> NextTickWrap -43
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -43 false
--> NextTickWrap -44
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -44 false
--> NextTickWrap -45
enter Zone { name: 'root', parent: undefined, context: {} }
exit Zone { name: 'root', parent: undefined, context: {} }
<-- NextTickWrap -45 false
--> NextTickWrap -46
enter Zone { name: 'root', parent: undefined, context: {} }
npm ERR! Test failed.  See above for more details.

@AndreasMadsen
Copy link

AndreasMadsen commented Sep 7, 2016

HTTPParser's init hook is only called the first time it's created and not called after reuse.

I can confirm this. See also nodejs/node#5573, my guess is that the PR won't land, but the issue will be fixed when AsyncWrap gets finalized.


I also gave your code a 30 sec look. I think it's correct, but I would suggest that you use uid and Map (cleanup in destroy) instead of handle and WeakMap. It's much more performant and in the future the handle will only be available from init.

@RobinQu
Copy link
Owner Author

RobinQu commented Sep 7, 2016

@AndreasMadsen Thanks for your review.

I found asyncwrap API in both 4.5LTS and 6.5 current, so I thought it was already finalized.

And then, I came across the nodejs/node-eps#18 you referenced and was surprised that there are so many upcoming changes.

@AndreasMadsen
Copy link

Yes, there is alot going on. Developing an API like AsyncWrap is a time consuming process and we can't simply create an API and hope for the best. The proposed API (eps) is the results from what we have learned from the current implementation, which have purposely been kept unofficial such that we could change it.

@RobinQu
Copy link
Owner Author

RobinQu commented Sep 7, 2016

@AndreasMadsen Understood. Looking forward to the next release so that we can make Zone a really working infrastructure that powers transactional scenarios like web server, data persistence etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants