timloo / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

wrong unix time #284

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

when I set key with expire time by using unix timestamp.
doen't work properly.

and found a problem.

==========
[server01] # date && \
                  _unixtime=`memcached-tool 127.0.0.1:11212 stats | grep -w time  | awk '{print $2}'` &&  \
                  gawk "BEGIN{print strftime(\"%c\",${_unixtime});exit}"

Fri Aug  3 11:38:58 2012
Fri Aug  3 11:54:40 2012
========== 
as u can c. the time stamp on memcached and the server is different.

when i restart memcached possess. the problem will be solved.

how can we fix this problem. is this a bug?
What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
CentOS release 5.7 (Final)
Kernel \r on an \m
2.6.18-274.12.1.el5xen
memcached 1.4.10

Original issue reported on code.google.com by RayMeibe...@gmail.com on 3 Aug 2012 at 2:49

GoogleCodeExporter commented 9 years ago
Swear I commented on this before...

memcached internally uses a monotonic clock, so the time changing outside of it 
won't change and break relative object expirations. Except if your clock is off 
when it starts, it'll be stuck that way.

I assume that's what's going on here, anyway.

Original comment by dorma...@rydia.net on 13 Jan 2013 at 1:02