corvus icon indicating copy to clipboard operation
corvus copied to clipboard

unknown command type 'Q' (parser.c:155)

Open viaweb3 opened this issue 7 years ago • 4 comments

phpredis

viaweb3 avatar Nov 09 '17 02:11 viaweb3

Thanks for reporting this. Do you know which command you're sending to corvus when encountering this error? Is your php client multi-threaded? Does the same error message get printed again and again? Need more information to figure out what's going on.

doyoubi avatar Nov 13 '17 04:11 doyoubi

php客户端是单线程短连接,会一直打印这个错误,由于是短连接,应该是socket关闭时的quit指令。

viaweb3 avatar Nov 20 '17 01:11 viaweb3

@pinguo-niulingyun 请问可以稳定复现吗? 求复现方法 (php版本, phpredis版本, 相关代码).

In case someone also has the same problem, it would be great if you can provide the way to reproduce it.

doyoubi avatar Nov 20 '17 02:11 doyoubi

@pinguo-niulingyun

Yeah, the problem exists in function "redis_sock_disconnect", something like this:

`PHPAPI int redis_sock_disconnect(RedisSock *redis_sock TSRMLS_DC) { if (redis_sock == NULL) { return 1; }

redis_sock->dbNumber = 0;
if (redis_sock->stream != NULL) {
        if (!redis_sock->persistent) {
            redis_sock_write(redis_sock, "*\r\n$4\r\nQUIT\r\n" _NL, sizeof("*\r\n$4\r\nQUIT\r\n" _NL) - 1 TSRMLS_CC);
        }`

The original string is simply "QUIT" which is not obey the text protocol. you should fix the source in your redis extension source code and recompile it to your dist.

jasonjoo2010 avatar Jan 15 '18 08:01 jasonjoo2010