Downgrade INFO string to ASCII #306

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@dvdplm
dvdplm commented Jan 2, 2013

On rare occasions we have seen Redis v2.4.17 instances with invalid data in the INFO response: used_memory_peak_human:\x90\f\x83\xFB\x83\u007F

The 'used_memory_peak_human' key should be a string on the form "12345.67K". For our instance the used_memory_peak:18446744073706301432 is very big, and looking at redis.c (for both 2.4.17 and 2.6.7) I suspect that bytesToHuman() is buggy and doesn't deal with such big values.

This patch simply downgrades the info string to ASCII when the encoding is invalid.

@djanowski
Member

Shouldn't this be addressed in Redis itself then?

@dvdplm
dvdplm commented Jan 23, 2013

It should: antirez/redis#858

@pietern
Member
pietern commented Feb 7, 2013

This change removes all invalid characters, so the INFO response you end up with is not really usable. I agree with @djanowski that this should be fixed in Redis itself and that redis-rb should not make an attempt to fix this bad behavior.

Closing the issue.

@pietern pietern closed this Feb 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment