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

get with cas token fails to fetch all results #14

Closed
andreiz opened this issue Apr 1, 2012 · 1 comment
Closed

get with cas token fails to fetch all results #14

andreiz opened this issue Apr 1, 2012 · 1 comment

Comments

@andreiz
Copy link
Member

andreiz commented Apr 1, 2012

Description:

When performing a get with a cas token requested a multi-get is performed
internally. After doing so
only the first result is fetched, leaving the final RES_END result on the
stack.
As per the
libmemcached documentation memcached_fetch_result should be called until it

returns NULL following a
multi-get.

In some circumstances this is not noticeable as libmemcached takes care of

flushing the receive buffers
accordingly, however certain subsequent operations will incorrectly return
the
left-over RES_END result.
I have seen this behaviour exhibited when performing a get with cas token
request followed by an add
operation though there may be other examples.

I have tested this with memcached extension version 2.0.0b2 using
libmemcached
0.53 and 1.0.2, though I
believe the issue also exists with earlier versions.

Please find attached a patch against 2.0.0b2 to address this issue which
both
resolves the primary issue
and also simplifies the call in the case that a cas token is not required
by
calling
memcached_get_by_key.

@mkoppanen
Copy link
Member

This has been fixed

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

No branches or pull requests

2 participants