Skip to content

Loading…

.in().listen().in().listen() throws error if cli plugin commands are used #149

Closed
nibblebot opened this Issue · 3 comments

2 participants

@nibblebot

Minimal test case server.js

```var path = require('path');
var cluster = require(path.join(__dirname+'/../cluster'));
cluster(require('http').createServer())
.use(cluster.pidfiles())
.use(cluster.cli())
.in('development').listen(3000)
.in('staging').listen(3020)


$ node server &
$ node server status
  master 28738 alive
  worker 0 28739 alive
  worker 1 28740 alive
  worker 2 28741 alive
  worker 3 28742 alive
  worker 4 28743 alive
  worker 5 28744 alive
  worker 6 28745 alive
  worker 7 28746 alive

TypeError: Cannot call method 'in' of undefined
    at Object.<anonymous> (/Users/josh/code/cluster_test/server.js:7:3)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at Array.<anonymous> (module.js:421:10)
    at EventEmitter._tickCallback (node.js:126:26)
@nibblebot nibblebot added a commit to nibblebot/cluster that referenced this issue
@nibblebot nibblebot fix for #149 401c940
@nibblebot

this also seems to fix a critical bug that has been preventing me from using cluster on my dev machine
here is an example where the above bug prevents a restart from executing normally

~/code/cluster_test node server status

master 29851 alive
worker 0 29852 alive
worker 1 29853 alive
worker 2 29854 alive
worker 3 29855 alive
worker 4 29856 alive
worker 5 29857 alive
worker 6 29858 alive
worker 7 29859 alive

TypeError: Cannot call method 'in' of undefined
at Object. (/Users/josh/code/cluster_test/server.js:7:3)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at Array. (module.js:421:10)
at EventEmitter._tickCallback (node.js:126:26)

~/code/cluster_test node server restart
TypeError: Cannot call method 'in' of undefined
at Object. (/Users/josh/code/cluster_test/server.js:7:3)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at Array. (module.js:421:10)
at EventEmitter._tickCallback (node.js:126:26)

[01:11 PM] josh@nyl2060n
~/code/cluster_test node server status

master 29866 alive
worker 0 29852 dead
worker 1 29853 dead
worker 2 29854 dead
worker 3 29855 dead
worker 4 29856 dead
worker 5 29857 dead
worker 6 29858 dead
worker 7 29859 dead

TypeError: Cannot call method 'in' of undefined
at Object. (/Users/josh/code/cluster_test/server.js:7:3)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at Array. (module.js:421:10)
at EventEmitter._tickCallback (node.js:126:26)

@tj
LearnBoost member
tj commented

good catch, thanks for the test as well i'll merge this over asap

@tj
LearnBoost member
tj commented

merged

@tj tj closed this
@tj tj added a commit that referenced this issue
@nibblebot nibblebot fix for #149 326439e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.