memcached_server_by_key is broken

Bug #1076048 reported by Massive Media on 2012-11-07
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Brian Aker

Bug Description

When upgrading from an older version (1.0.5) of libmemcached to 1.0.13, I notices that memcached_server_by_key returns invalid servers instead of just working as it should.

(I attached a test script)

The returned memcached_server_st *server is corrupt:
server->hostname is always empty and server->port is 65535

Related branches

Brian Aker (brianaker) on 2012-11-10
Changed in libmemcached:
assignee: nobody → Brian Aker (brianaker)
Brian Aker (brianaker) wrote :

memcached_server_by_key() returns a memcached_server_instance_st(), not a memcached_server_st().

The structures were similar enough such that at some point in history you could use one for the other, but this was not supported.

If you are rewriting the code I would look at using memcached(). It is much more flexible.

Brian Aker (brianaker) wrote :

Adding a test case with corrected code.

Changed in libmemcached:
status: New → Invalid
milestone: none → 1.0.14

The reason I filed this as a bug is because php-memcached supports it and has a function to retrieve the server for a given key. How should we do this?


To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers