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 returns NOTFOUND on timeout #67

Closed
m6w6 opened this issue Jan 20, 2020 · 3 comments
Closed

get returns NOTFOUND on timeout #67

m6w6 opened this issue Jan 20, 2020 · 3 comments

Comments

@m6w6
Copy link
Collaborator

m6w6 commented Jan 20, 2020

Imported from Launchpad using lp2gh.


Attached to this bug report is an example program showing that, when memcached successfully connects to a server, but that server is unresponsive to commands, the memcached_get function will return MEMCACHED_NOTFOUND rather than MEMCACHED_TIMEOUT.

The output is:
$ LD_LIBRARY_PATH=./libmemcached/.libs ./bug
memcached_lib_version 1.0.18
Connection accepted, now do nothing...
value: (null) error: NOT FOUND
last_error_message (0x6cc140) A TIMEOUT OCCURRED, No active_fd were found, host: localhost:11911 -> libmemcached/io.cc:259

I believe the problem stems from clobbering the timeout return in fetch.cc:

http://bazaar.launchpad.net/~tangent-trunk/libmemcached/1.0/view/head:/libmemcached/fetch.cc#L255

At this point, error is MEMCACHED_TIMEOUT but the result count is also zero, so the code decides it should be MEMCACHED_NOTFOUND instead.

Note that memcached_get did indeed return MEMCACHED_TIMEOUT way back in libmemcached-0.32.

@m6w6 m6w6 added the New label Jan 20, 2020
@m6w6
Copy link
Collaborator Author

m6w6 commented Jan 20, 2020

  • Comment by: lp:~skrulx:
  • Created at: 2016-02-02T00:34:37Z

@m6w6 m6w6 removed the New label Jan 20, 2020
@mjhags
Copy link

mjhags commented Aug 27, 2021

Ironically just been looking at this in the original libmemcached 1.0.18 and then stumbled on this github project and thought exactly the same.

I can't see any reason at all for that code line that converts an empty result into NOTFOUND, since unless I've missed something the error state is always set to something sensible by that point. So I'm now running a locally modified version with that bit removed entirely and all is well so far.

@m6w6
Copy link
Collaborator Author

m6w6 commented Sep 10, 2021

Fixed in 9f88736

@m6w6 m6w6 closed this as completed Sep 10, 2021
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