-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log_redis_info error #254
Comments
I have found the issue. When using info = await redis.info(section="Server") In essence, the code in
I can’t say for sure if this is an issue with Alternatively, this will fetch the values and make sure things won’t fail if the the returned values aren’t as expected. info_server, info_memory, info_clients, key_count = await asyncio.gather(
r.info(section="Server"),
r.info(section="Memory"),
r.info(section="Clients"),
r.dbsize(),
)
redis_version = info_server.get('server', {}).get('redis_version')
mem_usage = info_memory.get('memory', {}).get('used_memory_human')
clients_connected = info_clients.get('clients', {}).get('connected_clients')
log_func(
f'redis_version={redis_version} '
f'mem_usage={mem_usage} '
f'clients_connected={clients_connected} '
f'db_keys={key_count}'
) |
Hi @smlbiobot thanks for reporting this. I think the second solution would be great, I'll try and create a PR today. |
* log_redis_info, fix #254 * uprev * linting and fix CI
I am using a Redis Labs instance where for unknown reasons, the server infos are not being returned, and so the following throws a
ValueError
— I have yet to figure out what the issue is, and had to change this part ofconnections
to stop the issue:connections.py
It’s clearly an issue, possibly with Redis (or the Redis Enterprise Cloud - whom I am contacting also). However, since this is a non-crucial part of the library, it would be great if this unexpected behavior can be contained in a try-loop as above.
The text was updated successfully, but these errors were encountered: