Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Crash when disconnected from Disque #1

Closed
johnbona opened this issue Jan 6, 2016 · 0 comments
Closed

Crash when disconnected from Disque #1

johnbona opened this issue Jan 6, 2016 · 0 comments

Comments

@johnbona
Copy link
Contributor

johnbona commented Jan 6, 2016

Hi zensh!

I've been testing Disque using your client lib and during a simulated disconnect, thunk-disque crashed when trying to recover pending commands. Going to take a look at it and see what's the problem. 👍

Here's the debug output:

[nodemon] starting
  disque create socket, 192.168.99.100:7711 +0ms
  disque add command +15ms
 Command {
  data: <Buffer ...>,
  name: 'hello',
  callback: [Function],
  mayBeJobId: undefined }
  disque socket write, node 192.168.99.100:7711, length 15 +17ms
 <Buffer ...>
  disque socket connected, 192.168.99.100:7711 +0ms
  disque resp receive, node 192.168.99.100:7711 +3ms
 [ 1,
  'ac9a5c99eef25116f4f8b8a88d02d493f4745ff3',
  [ 'ac9a5c99eef25116f4f8b8a88d02d493f4745ff3', '', '7711', '1' ] ] Command {
  data: <Buffer ...>,
  name: 'hello',
  callback: [Function],
  mayBeJobId: undefined }

=====> Killed VM to simulate disconnect <=====
=====> Added job to a queue             <=====

  disque add command +4m
 Command {
  data: <Buffer ...>,
  name: 'addjob',
  callback: [Function: callback],
  mayBeJobId: 'testqueue' }
  disque socket write, node 192.168.99.100:7711, length 187 +1ms
 <Buffer ...>
thunk-disque Error: read EHOSTUNREACH
    at exports._errnoException (util.js:855:11)
    at TCP.onread (net.js:544:26)
  disque rescue pending commands, 192.168.99.100:7711 +55s
  disque socket reconnecting, 192.168.99.100:7711 +4s
  disque destroy socket, 192.168.99.100:7711 +1ms
  disque create socket, 192.168.99.100:7711 +1ms
thunk-disque Error: connect ETIMEDOUT 192.168.99.100:7711
    at Object.exports._errnoException (util.js:855:11)
    at exports._exceptionWithHostPort (util.js:878:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
  disque rescue pending commands, 192.168.99.100:7711 +26s
/node_modules/thunk-disque/lib/connection.js:61
  while (this.pendingQueue.length) {
                          ^

TypeError: Cannot read property 'length' of null
    at Connection.rescuePending (/node_modules/thunk-disque/lib/connection.js:61:27)
    at Connection.reconnecting (/node_modules/thunk-disque/lib/connection.js:145:10)
    at Socket.<anonymous> (/node_modules/thunk-disque/lib/connection.js:119:11)
    at Socket.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at TCP._onclose (net.js:469:12)
[nodemon] app crashed

Configuration:
Mac OS X El Cap - 10.11.2
node.js - 5.3.0
thunks-disque - master @ 3393055

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

No branches or pull requests

1 participant