snehac-miner / redis

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

Useful error messaging when out of memory #105

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If I exceed the memory allocated to Redis, I (expectedly) get the following
error:

$ ./redis_test.py 
Traceback (most recent call last):
  File "./redis_test.py", line 8, in <module>
    r.set(1,'0123456789')
  File "/usr/lib/pymodules/python2.6/redis.py", line 137, in set
    return self.get_response()
  File "/usr/lib/pymodules/python2.6/redis.py", line 975, in get_response
    raise ResponseError(data[5:] if data[:5] == '-ERR ' else data[1:])
redis.ResponseError: command not allowed when used memory > 'maxmemory'
rlowe@hp1k:~/scratch$ 

It would be useful to me to have the following two data points in the error
output:

- How many bytes were needed to complete the operation
- How much memory was allocated to Redis at the time (redis.conf is not
necessarily authoritative)

Original issue reported on code.google.com by ryan.a.l...@gmail.com on 18 Nov 2009 at 3:07

GoogleCodeExporter commented 8 years ago
"how many memory where needed" is a low level information that I think should 
not be exported, instead, how much memory was allocated can be requested via 
INFO. Also using "CONFIG GET maxmemory" it is possible to access the current 
configuration.

Original comment by anti...@gmail.com on 23 Aug 2010 at 3:56