Closed Dmitry-N-Medvedev closed 6 years ago
Hi!
It seems that I do not understand how to properly shutdown redis client. Please, see below.
helper function:
module.exports.stop = async (redis) => { const endEventPromise = eventPromise('end', redis); const endOpPromise = new Promise((resolve, reject) => { try { redis.end(); redis = null; resolve(); } catch(err) { reject(err); } }); return await Promise.all([endEventPromise, endOpPromise]); }
before start:
127.0.0.1:6379> CLIENT LIST id=2 addr=127.0.0.1:49254 fd=7 name= age=4798 idle=4798 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=NULL id=3 addr=127.0.0.1:49256 fd=8 name= age=4798 idle=4798 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=NULL id=37 addr=127.0.0.1:50122 fd=9 name= age=2 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
after stop:
127.0.0.1:6379> CLIENT LIST id=2 addr=127.0.0.1:49254 fd=7 name= age=4807 idle=4807 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=NULL id=3 addr=127.0.0.1:49256 fd=8 name= age=4807 idle=4807 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=NULL id=37 addr=127.0.0.1:50122 fd=9 name= age=11 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client id=38 addr=127.0.0.1:50128 fd=10 name= age=4 idle=4 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=NULL
Note fd=10 is still active
after client kill:
127.0.0.1:6379> CLIENT LIST id=2 addr=127.0.0.1:49254 fd=7 name= age=4905 idle=4905 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=NULL id=3 addr=127.0.0.1:49256 fd=8 name= age=4905 idle=4905 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=NULL id=37 addr=127.0.0.1:50122 fd=9 name= age=109 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client 127.0.0.1:6379>
Note fd=10 has gone.
Can not reproduce, please try to set CLIENT SETNAME "driver" on start, or give me a full example, please.
CLIENT SETNAME "driver"
Please try new version of driver, should work
Hi!
It seems that I do not understand how to properly shutdown redis client. Please, see below.
helper function:
before start:
after stop:
Note fd=10 is still active
after client kill:
Note fd=10 has gone.