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

benchmark/pub.js often crashes after benchmark/sub.js exits #61

Closed
AlexeyKupershtokh opened this issue Oct 23, 2012 · 3 comments
Closed

Comments

@AlexeyKupershtokh
Copy link
Contributor

ubuntu 11.04, node 0.8.12, axon 0.4.2

wicked@wicked-desktop:~/s2s/node_modules/axon/benchmark$ node pub.js
...
  axon:pub flushBatch to 1 sockets, 1 writable +0ms
  axon:pub flushBatch to 1 sockets, 0 writable +1ms
  ...
  axon:pub flushBatch to 1 sockets, 0 writable +0ms
  axon:sock disconnect 127.0.0.1:50770 +633ms
  axon:sock start total sockets: 1 +0ms
  axon:sock remove socket 0 +0ms
  axon:sock end total sockets: 0 +0ms
  axon:sock on('error') socket= +3ms { _handle: null,
  _pendingWriteReqs: 1481,
  _flags: 0,
  _connectQueueSize: 0,
  destroyed: true,
  errorEmitted: true,
  bytesRead: 0,
  _bytesDispatched: 72095400,
  allowHalfOpen: false,
  writable: false,
  readable: false,
  server: 
   { _events: { connection: [Function], listening: [Function] },
     _connections: 0,
     connections: [Getter/Setter],
     allowHalfOpen: false,
     _handle: 
      { writeQueueSize: 0,
        onconnection: [Function: onconnection],
        owner: [Circular] },
     _connectionKey: '4:0.0.0.0:3003' },
  _peername: { address: '127.0.0.1', family: 'IPv4', port: 50770 },
  _events: 
   { data: [Function],
     error: [Function],
     timeout: [Function],
     close: [Function] },
  _connecting: false,
  _connectQueue: null,
  _idleNext: null,
  _idlePrev: null,
  _idleTimeout: -1 }
  axon:sock error This socket is closed. +1ms
  axon:sock start total sockets: 0 +0ms
  axon:sock removal of unknown socket +0ms

events.js:68
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: This socket is closed.
    at Socket._write (net.js:518:19)
    at Socket.write (net.js:510:15)
    at PubSocket.flushBatch (/home/wicked/Alawar/s2s/node_modules/axon/lib/sockets/pub.js:60:14)
    at PubSocket.send (/home/wicked/Alawar/s2s/node_modules/axon/lib/sockets/pub.js:80:54)
    at more (/home/wicked/Alawar/s2s/node_modules/axon/benchmark/pub.js:21:42)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)  

I propose similar fix to pub.js as done here:
websockets/ws#74

PS: also note double socket removal, once on 'close' event then once on 'error'.

@AlexeyKupershtokh
Copy link
Contributor Author

PS: I had to make debug more verbose as you see.

@gjohnson
Copy link
Collaborator

As far as the double removal, thats actually just debug info. One of the down sides of pushing in some new error handling last week was some hacky socket checking for the time being. Not positive if this error is related though... will take a peak later.

@AlexeyKupershtokh
Copy link
Contributor Author

Added a pull request.
#62

@tj tj closed this as completed Oct 24, 2012
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

3 participants