Comments (4)
Hello, this is a bug indeed and it is due to an integer overflow that only
happens in 32 bit builds.
However there is no perfect fix as time_t is 32 bit in 32 bit archs. What I'm
probably going to do is to set it to the max unix time when it would overflow,
so that those keys will expire in 2036. But this somewhat violates the
semantics as you set a given expire and read a different one using the TTL
command... better to think a bit more about it :) But this is likely the best
fix for 32 bit.
Thanks for reporting.
Salvatore
Original comment by [email protected]
on 12 Sep 2011 at 11:33
from redis.
Original comment by [email protected]
on 12 Sep 2011 at 11:34
- Changed state: Accepted
from redis.
Redis already appears to reject larger expiration times (e.g. anything over
2**31 on my system). I think that rejecting values that would overflow a 32-bit
value after being added to the current time would be an acceptable solution.
An argument may be made that redis should not fall apart around year 2037 and
should support 64-bit times on all architectures. This argument is somewhat
orthogonal to the bug here - redis should never overflow the time value; if on
a 64-bit system I specify 2**64-1000 as the expiration value it should either
be rejected or treated correctly as a future value, instead of being wrapped
around at 2**64.
Due to redis requesting a delta for the expiration time, people who want to
specify a value far in the future are likely to use something like "10 years
from now" as opposed to "January 1, 2020". As we get closer to 2037 having
32-bit values for times will begin to affect more users.
Requiring a 64-bit redis for proper time handling has its own drawbacks. One is
increased memory consumption of 64-bit redis, which is addressed in the faq.
Another one is continuing existence of low-spec servers with under 4 gb of ram,
where running a 64-bit operating system makes little or no sense.
In my case there was a bug in the code and I actually wanted a reasonable
expiration time, but due to porting the code from memcached it misspecified the
delta as a timestamp.
Original comment by [email protected]
on 13 Sep 2011 at 2:10
from redis.
Thanks for the additional details, I moved the issue to the new issue system at
github so that we can address it ASAP. Cheers.
Original comment by [email protected]
on 20 Sep 2011 at 10:19
from redis.
Related Issues (20)
- BRPOPLPUSH return type is contingent on success HOT 2
- A 8G .aof file lead redis loading so slowly... HOT 3
- The command "config get databases" does not return
- Allow SORT Command to STORE results as sorted set HOT 1
- Even after flushall maxmemory shows the previous max value. HOT 10
- [FEATURE REQUEST]HMSETX/HSETX HOT 3
- BRPOPLPUSH and a single LPUSH with several items doesn't work well together HOT 2
- Suggestion on either using AOF or Save setting HOT 4
- [FEATURE REQUEST]maxmemory-policy HOT 4
- The issue about the special scenario in redis-2.2.12 HOT 5
- Need Git Tag for 2.2.13 HOT 1
- DBNUM Command HOT 4
- EXPIREAT make test fails
- Hello, antirez. At what time release b-tree version disk store? HOT 1
- make test error CentOS HOT 2
- Could not connect to Redis at 127.0.0.1:6379: Connection refused HOT 1
- configure bind two interface
- minor change (call to id instead of whoami) in install script HOT 1
- /
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis.