memcache icon indicating copy to clipboard operation
memcache copied to clipboard

Check for undefined peekCommand queue entry

Open jplhomer opened this issue 2 months ago • 1 comments

Fixes #26

Problem

In some cases, bad commands (e.g. invalid keys) sent in parallel at a high throughput to a memcache server will result in the error described in #26.

Since this code path runs in an event listener after client initialization and not as a result of a function called in user land, this results in a crashed Node.js process (aka uncaught exception).

Solution

Check retrieve for truthiness before attempting to push a value on it or set .error on it.

This doesn't solve the underlying root/concurrency problem per-se, but it makes the method more resilient to upstream failure.

jplhomer avatar Sep 29 '25 18:09 jplhomer

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 29 '25 18:09 CLAassistant