Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Exceptions while big load #26

Open
shunanya opened this issue Aug 29, 2012 · 8 comments
Open

Exceptions while big load #26

shunanya opened this issue Aug 29, 2012 · 8 comments

Comments

@shunanya
Copy link

When I use memcache library on big load (more than 20 req/sec) I am get the exception during getting data like depicted below

/home/shunanya/worksp_node/test/node_modules/memcache/lib/memcache.js:260
    var type = this.callbacks[0].type;
                                ^
TypeError: Cannot read property 'type' of undefined
    at Client.determine_reply_handler (/home/shunanya/worksp_node/test/node_modules/memcache/lib/memcache.js:260:30)
    at Client.handle_received_data (/home/shunanya/worksp_node/test/node_modules/memcache/lib/memcache.js:217:21)
    at Socket.Client.connect.conn.addListener.self.conn (/home/shunanya/worksp_node/test/node_modules/memcache/lib/memcache.js:62:12)
    at Socket.EventEmitter.emit (events.js:88:17)
    at TCP.onread (net.js:403:14)

In my opinion, it doesn't have enough time to store the callback function in the array and this is the reason for exception.
I use currently the Node.js 0.8.8 and Memcached 1.4.14 under Ubuntu 11.10.
Hope, this issue can be fixed soon:)

Simon

@hbhasker
Copy link

hbhasker commented Oct 8, 2012

This is an issue I am noticing as well. From what I can see it fires the callback before the data is complete or something sometimes or is firing a callback when none exist.

@giggsey
Copy link

giggsey commented Nov 5, 2012

+1

@1999
Copy link

1999 commented Jan 7, 2013

It seems like the error does not depend on the number of the tasks being made to memcached server. Some piece of data comes when no listener is bound. The data comes without any request being made to memcached server, so the problem is to get what is this piece of data about.

// dirty hack (stderr will also contain the data):
this.conn.addListener("data", function (data) {
  self.buffer += data;
  try {
    self.handle_received_data();
  } catch (e) {
    util.error('Error: data handling impossible. Data chunk: ' + data);
    self.buffer = '';
  }
});

UPD: i created a gist repository to reproduce this problem: https://gist.github.com/4554582
Pull request from issue #22 fixes this just partly

@henpatel
Copy link

Hey guys, we are having a similar issue. Is there a work around?

@1999
Copy link

1999 commented Jun 3, 2013

@henpatel i moved to npm's memcached, but found another bug. Whoa!
If you want to continue using node-memcache, look #22 for partial fix of this problem.

@masonzhang
Copy link

This happens on my server also, I use latest node-memcache and Couchbase to setup memcached server. Any thoughts? Here are my full call stack:

/Server/node_modules/memcache/lib/memcache.js:260
var type = this.callbacks[0].type;
^
TypeError: Cannot read property 'type' of undefined
at Client.determine_reply_handler (/Server/node_modules/memcache/lib/memcache.js:260:30)
at Client.handle_received_data (/Server/node_modules/memcache/lib/memcache.js:217:21)
at Socket. (/Server/node_modules/memcache/lib/memcache.js:62:12)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket. (stream_readable.js:736:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable
(_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)

@exos
Copy link

exos commented Oct 10, 2013

I Have the same error, and I tryed with compress the data and fails.

@masonzhang
Copy link

@exos The answer is in comment of the user "1999". Pull Request #23: Fixed bug when 'END' is contained in the cached data. But it does not completely fix this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants