memcp gets expiration time wrong

Bug #1261128 reported by Thomas Bachem
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libmemcached
In Progress
Medium
Brian Aker

Bug Description

The memcp (memccp on Debian systems) command line utility gets the supplied expire time wrong:

    memcp --verbose --servers=localhost --set --expire=1418563176 "foo:bar"
    op: set
    source file: foo:bar
    length: 4
    key: foo:bar
    flags: 0
    expires: 86307647862
    Calling memcached_free()

Providing a value of 54900000 leads to 1418723328, which brings me very near to my desired expiration time of 1418563176.

I tested this on Mac OS X 10.8.5 and Linux Debian 7.2.

Related branches

Revision history for this message
Aaron Morand (aaronm) wrote :

I'm seeing this same issue on CentOS 5.6 and Ubuntu 12.04.

CentOS 5.6 with libmemcached version 1.0.4-3.el5

Ubuntu 12.04 with libmemcached version 0.42 and 0.44

As libmemcached evaluates the expire time differently depending upon if the seconds passed are < 30 days, it's worthwhile to note the same anomaly is seen with a much smaller value.

echo "Y" > testkey
memcp --verbose --debug --servers=localhost --expire=120 testkey
op: set
source file: testkey
length: 1
key: testkey
flags: 0
expires: 288

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

The < 30 day expiration trick is how Memcached itself works. libmemcached is just the transport.

Changed in libmemcached:
status: New → Invalid
Revision history for this message
Thomas Bachem (3-eail-2) wrote :

Did you even read my original ticket? It has nothing to do with the 30 day behaviour.

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

Hit the wrong field :)

The bug is how the number is being read (one fix coming up).

Changed in libmemcached:
status: Invalid → In Progress
assignee: nobody → Brian Aker (brianaker)
importance: Undecided → Medium
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.