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

Closed
nibblebot opened this Issue Sep 19, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@nibblebot
Contributor

nibblebot commented Sep 19, 2011

Minimal test case server.js

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. (/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)

nibblebot added a commit to nibblebot/cluster that referenced this issue Sep 19, 2011

@nibblebot

This comment has been minimized.

Show comment
Hide comment
@nibblebot

nibblebot Sep 19, 2011

Contributor

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)

Contributor

nibblebot commented Sep 19, 2011

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

This comment has been minimized.

Show comment
Hide comment
@tj

tj Sep 19, 2011

Member

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

Member

tj commented Sep 19, 2011

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

@tj

This comment has been minimized.

Show comment
Hide comment
@tj

tj Sep 19, 2011

Member

merged

Member

tj commented Sep 19, 2011

merged

@tj tj closed this Sep 19, 2011

tj added a commit that referenced this issue Sep 19, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment