Skip to content

Export connection error information to client #1053

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

Open
sjpotter opened this issue Mar 21, 2022 · 2 comments
Open

Export connection error information to client #1053

sjpotter opened this issue Mar 21, 2022 · 2 comments
Assignees

Comments

@sjpotter
Copy link

when one is using hiredis (at least in async mode), it is very difficult (if not impossible) to understand why a connection failed, especially if one is using TLS.

i.e. the onConnect handler is just called with a NULL reply object. as it is NULL, you know it failed, but have no idea why. For plain connections, it might not matter, but when TLS is involved, you will want to know if it was a TLS issue.

while openssl allows you to query it for its last error, in an async environment, you are no longer guaranteed to get the correct result associated to the right connection.

@michael-grunder
Copy link
Collaborator

I need to dig into this to see what could be done about it.

It's been a while since I've used the async API but can you query the error state through the attached redisContext structure (inside of the redisAsyncContext), or has that been clobbered by the time you are in your onConnect handler?

One solution could be to allow users to create a new onConnect callback that hiredis could pass a context structure with TCP/TLS error information.

@sjpotter
Copy link
Author

need to think about this, not so much in my current memory context. @yossigo might have ideas as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants