-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Thrown stream error while uncorking #1033
Comments
Cork / uncork is called on each This is very certain an issue with Node.js and not with node_redis. You should definitely not run into a TypeError by calling uncork. |
In order for this to happen, the client is issuing synchronously multiple @BridgeAR yes it is. However you might want to check if the way used to (A fix is on the way). |
@mcollina for my use case using nextTick or not did not show any difference in my benchmarks, so I decided to use the sync version. I'll switch to nextTick though. Thanks for pointing out that this circumvents that bug 👍 @jfhbrook thanks for bringing this up! |
@BridgeAR not using Yeah, |
Yes, we use exec/batch heavily. |
Note - Possibly related: #1029 |
This is me blatantly cross-posting [https://github.com/nodejs/node/issues/6154](this node core issue) because I don't actually know that it's their fault.
I have some production services that are throwing a pretty crazy error:
For some background: We're using redis as a caching layer, and this code is getting triggered while writing to redis with its 'multi' helper. We're using v2.4.2 of the redis module but I'm gonna upgrade to 2.5.3 just in case it helps.
As far as I can tell, what's happening here is that the redis client creates a net stream and at various points in time might call uncork on it, including inside the multi exec handler. For some reason, only sometimes, when this happens, trying to clear the buffer throws because state.corkedRequestsFree is null.
I did look at net and Duplex code paths, as well as the redis code, and didn't see anything touching internal stream state, but maybe I missed something?
Unfortunately, I don't have a reproducing case beyond the production code. I tried triggering this with a naive fuzzer on a writable stream, no dice.
Thanks!
The text was updated successfully, but these errors were encountered: