Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Open
ManuelPU opened this Issue · 0 comments

1 participant

ManuelPU
ManuelPU

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
Something went wrong with that request. Please try again.