ahww520 / xmemcached

Automatically exported from code.google.com/p/xmemcached
Apache License 2.0
0 stars 0 forks source link

Session (...) has been closed #204

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
memcachedClientBuilder.setCommandFactory(new BinaryCommandFactory());

用Binary模式的时候,如果传入的 key 
大于memcached服务器的key最大长度时(默认250), 
不会报超出key长度的错误,而是直接报 Session (...) has been 
closed 。。。。

用text模式时会正常报错

Original issue reported on code.google.com by yriio...@gmail.com on 12 Jul 2012 at 9:10

GoogleCodeExporter commented 8 years ago
恩,这是个bug,二进制协议本来应当允许key长度任意,但是me
mcached还是限制在255字节了。但是xmemcached却放开这个限制。

目前来说,你应该避免这么长的key,也可以利用1.3.8提供的Key
Provider对key做截断或者md5 hash。

Original comment by killme2...@gmail.com on 16 Jul 2012 at 11:52