Closed tmikaeld closed 1 year ago
Any update on this? I'm also unable to reconnect after a broken pipe, I tried to patch it but whatever I try like Deno.close(conn)
or conn.close()
but it just stalls forever.
The error I was getting before stalls:
An error occurred: BadResource: Bad resource ID
at write (ext:deno_net/01_net.js:31:21)
at TcpConn.write (ext:deno_net/01_net.js:94:12)
at writeAll (https://deno.land/std@0.200.0/streams/write_all.ts:32:25)
at writeCommand (https://deno.land/x/r2d2@v1.1.11/mod.ts:81:9)
at sendCommand (https://deno.land/x/r2d2@v1.1.11/mod.ts:317:9)
at CommandQueue.processQueue (file:///home/main/workspace/proxy/src/lib/redis.js:27:30)
at eventLoopTick (ext:core/01_core.js:183:11) {
name: "BadResource"
}
Hi @tmikaeld, I'm very sorry for the late reply. I'll look into this within the next few days.
There's no rush to look at this, we're switching back to denodrivers/redis
meanwhile, since we need stable redis in prod.
I fixed the race condition issue on my local machine using a simple queue mechanism. Please check and try it out here: https://github.com/iuioiua/r2d2/tree/queue-trial
I'll have to make some fairly fundamental changes to this module because of this, along with some updates relating to deprecations in the Standard Library. Keep your eyes peeled 👀 and let me know how testing of that tree goes 👍🏾
Thanks for looking into this, looks great and the tests pass as well!
Sorry for the late reply, I've been busy with our launch.
Was confused why connections would stall/hang when reading many keys async.
It's because when using 1 connection, redis needs a queue.
As you can see in the older driver here: https://github.com/search?q=repo%3Adenodrivers%2Fredis%20queue&type=code
Something like this maybe (untested):