-
Notifications
You must be signed in to change notification settings - Fork 30
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
TypeError: Cannot read property 'type' of undefined #75
Comments
Connection.prototype.read = function(data) {
var deferred = this.commandBuffer.first();
if (deferred.type === 'autodiscovery') { // here It'd crash when |
Hi @kawanet , Could you please share how I can reproduce this issue. |
I'm sorry but I don't have a reproducible code at this moment. I'm not sure but I guess I've faced the crash when I perform a Our app has been changed not to make such a larger string appended. I'm now not facing the problem, then. |
We're getting this same issue in a high volume production environment. The app crashes every 5 minutes or so and gets restarted. We had to roll back to a version without memcache for now. In QA environments with a small load, it never happens. Our data items are all generally all very small, but guaranteed under 64KB, so we're nowhere near 1MB. We also do not use |
I can reproduce the problem simply by storing an empty string as the value. In Connection.read near the bottom, there is what appears to be a pointless if statement that just breaks memcache-plus in this edge case It appears that if you store an empty string or certain other keywords such as literally the word END as the value, the parser gets out of sync when you try to read that key, and will crash your whole app shortly. |
This parser might be just fundamentally flawed for the memcached protocol, I'm not sure. It seems to ignore the length value read and stored in metadataTemp and just blindly assume each incoming line after a VALUE response can be a command response instead of part of the data. |
I fixed this in https://github.com/ryanrubleycoates/memcache-ppp and would be happy if the fixes there (and memcache-pp) made it back to memcache-plus, but I'm not sure if they will. The issue can be caused by return values that are empty strings, keywords such as END, or other things that cause the reply parser to get out of sync. |
Seeing this issue as well still. I've actually yet to be able to run a successful |
This still occurs on some data. |
It crashes with the stack trace as below:
I'm running a benchmark script which calls many get/set/append/remove commands.
It works in most cases, and crashes in other cases at the same environment.
The text was updated successfully, but these errors were encountered: