yiisoft / yii2-redis

Yii 2 Redis extension.
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
452 stars 183 forks source link

Redis reconnect error #176

Closed kshart closed 2 years ago

kshart commented 5 years ago

Eng translete

Problem

What's expected?

For retries = 0 in case of errors in Connection::executeCommand close connection For retries > 0 in case of errors in Connection::executeCommand do not write zero in retries

What do you get instead?

For retries = 0 in case of errors in Connection::executeCommand connection does not close For retries > 0 in case of errors in Connection::executeCommand in retries it is written zero

Rus

Проблема

Что ожидается?

для retries = 0 при ошибках в Connection::executeCommand закрывать соединение для retries > 0 при ошибках в Connection::executeCommand не обнулять retries

Что вы получаем вместо этого?

для retries = 0 при ошибках в Connection::executeCommand соединение не закрывается для retries > 0 при ошибках в Connection::executeCommand обнуляется retries

Additional info

Q A
Yii vesion 2.0.14.2
PHP version 7.2.10
Operating system Ubuntu 18.04.1
Yii2-redis 2.0.9
cebe commented 5 years ago

* If `retries` = 0 then `Connection::executeCommand` on throwing `SocketException` will never close the connection and will not open [in code](https://github.com/yiisoft/yii2-redis/blob/ac8f7b75df9837d5b2a0f1cafa22cb815b9623a0/src/Connection.php#L697)

this is expected, if you do not tell it to retry, it does not retry.

For retries > 0 in case of errors in Connection::executeCommand do not write zero in retries

I agree that this should be fixed.