Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

ping function call returns PONG when Redis server is not running (sock connection). #773

Closed
dstruck opened this issue Jul 3, 2020 · 6 comments
Labels
bug easy Good first PR help wanted resolved-via-latest This indicates this issue is either resolved or invalid as of the latest version.

Comments

@dstruck
Copy link

dstruck commented Jul 3, 2020

import aioredis
conn = await aioredis.create_redis_pool('unix:///var/run/redis/redis-server.sock?db=0')
await conn.ping()

returns b'PONG' even though the server is not running.

import redis
r = redis.Redis('unix:///var/run/redis/redis-server.sock?db=0')
r.ping()

raises the ConnectionError exception.

aioredis should not return b'PONG' on its own, it should only come from a Redis server.

Maybe self._process_data(data or b'PONG') (aioredis/connection.py) is the culprit?

@seandstewart
Copy link
Collaborator

@dstruck -

Thanks for the ticket and the initial investigation! Would you be willing to submit a PR with a potential fix for this problem?

@seandstewart seandstewart added this to To do in Resuscitation via automation Nov 14, 2020
@miketzian
Copy link

Might this be already fixed, or had some other cause?

I get FileNotFoundError when redis isn't running and ConnectionRefusedError when I try to fake the file (was going to look at fixing this)

@seandstewart
Copy link
Collaborator

@miketzian -

It has not - would welcome a PR with a fix if you have time.

@miketzian
Copy link

I'd be happy to, though I can't reproduce it. When redis isn't running, the socket file doesn't exist and I get a FileNotFoundError and not b'PONG'

@waketzheng
Copy link
Contributor

My machine is Mac with aioredis1.3 and got FileNotFoundError either. @dstruck how to reproduct that pong?

@seandstewart
Copy link
Collaborator

This issue should be resolved as of #891 - please feel free to pull in the latest master and test to ensure this is the case.

Resuscitation automation moved this from To do to Done Mar 19, 2021
@seandstewart seandstewart added the resolved-via-latest This indicates this issue is either resolved or invalid as of the latest version. label Mar 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug easy Good first PR help wanted resolved-via-latest This indicates this issue is either resolved or invalid as of the latest version.
Projects
No open projects
Development

No branches or pull requests

4 participants