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

uncaught exception: protocol tries to read unavailable data #46

Open
bgrosse-midokura opened this issue May 10, 2020 · 2 comments
Open
Labels
bug Something isn't working

Comments

@bgrosse-midokura
Copy link

bgrosse-midokura commented May 10, 2020

    at Function.byteLength (buffer.js:515:11)
    at Protocol.parse (/home/gipsy/o/qdice/node_modules/tedis/src/core/protocol.ts:74:29)
    at Socket.<anonymous> (/home/gipsy/o/qdice/node_modules/tedis/src/core/base.ts:133:23)
    at Socket.emit (events.js:189:13)
    at Socket.EventEmitter.emit (domain.js:441:20)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:265:11)
    at Socket.Readable.push (_stream_readable.js:220:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

My guess is that, on larger values, the socket stream's data event might not always send $<size> together with whatever is expected next, it might send it in two (or more) events. But base/protocol only knows to parse this at once. I tried to fix it but couldn't figure it out.

@dasoncheng
Copy link
Contributor

Can you provide case data, or the size of the data that caused the error?

@dasoncheng dasoncheng added the bug Something isn't working label Nov 3, 2020
@emowen4
Copy link

emowen4 commented Nov 21, 2020

We met the same issue here. When the string data size is kind of large (around 30000 chars), this error would occur randomly without any ways to handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants