yyfrankyy/h2dns

ECONNRESET cause crash

Closed this issue · 2 comments

{ Error: socket hang up
    at TLSSocket.onHangUp (_tls_wrap.js:1092:19)
    at TLSSocket.g (events.js:291:16)
    at emitNone (events.js:91:20)
    at TLSSocket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickDomainCallback (internal/process/next_tick.js:122:9) code: 'ECONNRESET' }

Looks like spdy remove the error listener intentionally.

https://github.com/indutny/node-spdy/blame/master/lib/spdy/agent.js#L110

Error: read ECONNRESET
    at exports._errnoException (util.js:1026:11)
    at TLSWrap.onread (net.js:569:26)
---------------------------------------------
    at TLSSocket.Readable.on (_stream_readable.js:687:35)
    at Connection.init [as _init] (/Users/frank/projects/h2dns/node_modules/spdy-transport/lib/spdy-transport/connection.js:181:15)
    at new Connection (/Users/frank/projects/h2dns/node_modules/spdy-transport/lib/spdy-transport/connection.js:140:8)
    at Function.create (/Users/frank/projects/h2dns/node_modules/spdy-transport/lib/spdy-transport/connection.js:146:10)
    at TLSSocket.<anonymous> (/Users/frank/projects/h2dns/node_modules/spdy/lib/spdy/agent.js:130:43)
    at emitNone (events.js:91:20)
    at TLSSocket.emit (events.js:185:7)
    at TLSSocket.<anonymous> (_tls_wrap.js:1083:14)
---------------------------------------------
    at TLSSocket.Readable.on (_stream_readable.js:687:35)
    at Agent._connect (/Users/frank/projects/h2dns/node_modules/spdy/lib/spdy/agent.js:109:10)
    at Agent._init (/Users/frank/projects/h2dns/node_modules/spdy/lib/spdy/agent.js:57:8)
    at new Agent (/Users/frank/projects/h2dns/node_modules/spdy/lib/spdy/agent.js:24:10)
    at Function.create (/Users/frank/projects/h2dns/node_modules/spdy/lib/spdy/agent.js:29:12)
    at Object.create [as createAgent] (/Users/frank/projects/h2dns/node_modules/spdy/lib/spdy/agent.js:273:26)
    at AgentPool.createAgent (/Users/frank/projects/h2dns/h2dns:69:17)
    at AgentPool.aquire (/Users/frank/projects/h2dns/h2dns:53:19)
    at Object.get (/Users/frank/projects/h2dns/h2dns:86:24)
---------------------------------------------
    at new Server (/Users/frank/projects/h2dns/dnsd/server.js:33:10)
    at Object.createServer (/Users/frank/projects/h2dns/dnsd/server.js:20:10)
    at Object.<anonymous> (/Users/frank/projects/h2dns/h2dns:100:21)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

good, i now see how it uses another before openend "Agent“ Connection if one later reset.