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

TypeError: Cannot call method 'take' of null #17

Open
ManuelPU opened this issue Aug 9, 2013 · 0 comments
Open

TypeError: Cannot call method 'take' of null #17

ManuelPU opened this issue Aug 9, 2013 · 0 comments

Comments

@ManuelPU
Copy link

ManuelPU commented Aug 9, 2013

At one host environment, i have created this config:

{
"servers": [{
"host": "localhost"
,"port": 7111
}
, {
"host": "localhost"
, "port": 7112
}
, {
"host": "localhost"
, "port": 7114
}
]
,"mode": "readsToSlaves"
,"listen_port": 9999
,"bind_address": "0.0.0.0"
,"check_period": 5000
,"pool_size": 50
, "debug": "yes"
, "slave_balance": "roundrobin"
, "loggers":[{ "filename": "redis-proxy.log", "level":"silly" } ]
}

After redis-proxy activation:

info: localhost:7111 is slave of no one
debug: We have a server that went up
info: Marking localhost:7112 as slave of localhost: 7111
debug: We have a server that went up
info: Marking localhost:7114 as slave of localhost: 7111

Redis-cli –p 9999 works!!!
I will kill 7111:

info: Creating the pool for active server7112
info: localhost:7112 is slave of no one
info: Marking localhost:7114 as slave of localhost: 7112

Redis-cli –p 9999 works!!!
I will launch again 7111 and I will kill 7112 (that is master at this moments)

error: Redis connection to localhost:7112 failed - connect ECONNREFUSED
error: Main server down PANIC
info: finding next active server.
info: Creating the pool for active server7111
info: localhost:7111 is slave of no one
info: Marking localhost:7114 as slave of localhost: 7111
info: Setting up as active localhost : 7111

Redis-cli –p 9999 works!!!
Killing 7111 …

error: Main server down PANIC
info: finding next active server.
info: Creating the pool for active server7114
info: localhost:7114 is slave of no one
info: Setting up as active localhost : 7114

Now , redis-cli –p 9999 doesn’t work.

/home/manu/redis-proxy-master/lib/server.js:56
this.connections.take(id, function(err, conn){
^
TypeError: Cannot call method 'take' of null
at Server.sendCommand (/home/manu/redis-proxy-master/lib/server.js:56:20)
at RedisProxy.readsToSlaves (/home/manu/redis-proxy-master/lib/redis_proxy.js:103:23)
at Socket. (/home/manu/redis-proxy-master/server.js:31:17)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket. (stream_readable.js:736:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable
(_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
Could not connect to Redis at 127.0.0.1:9999: Connection refused

How can i solve it?

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

1 participant