memcached_server_by_key is broken

Bug #1076048 reported by Massive Media
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libmemcached
Invalid
Undecided
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

Revision history for this message
Massive Media (493pocbrcycmdw7yksonho9o2qzz-o18bz-d18ecat4t1b76tkfi3vttrkfngli) wrote :
Brian Aker (brianaker)
Changed in libmemcached:
assignee: nobody → Brian Aker (brianaker)
Revision history for this message
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.

Revision history for this message
Brian Aker (brianaker) wrote :

Adding a test case with corrected code.

Changed in libmemcached:
status: New → Invalid
milestone: none → 1.0.14
Revision history for this message
Massive Media (493pocbrcycmdw7yksonho9o2qzz-o18bz-d18ecat4t1b76tkfi3vttrkfngli) wrote :

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?

Best,
Nicolas

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.