Skip to content
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

timeout instead of race to fix async wait time #222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

g-divyanshu
Copy link

@g-divyanshu g-divyanshu commented Feb 25, 2024

Problem Statement: In an application deployed in my organisation, we were seeing an increased time to connect to redis, when we increased the value of connectTimeout.

Reason: This was happening because of the higher timeout value which was being passed to race in connect function as timeoutOpt. Function race internally calls cancel and cancel will not terminate until the thread that Async refers to has been terminated.

Solution : Used timeout function instead of race to handle that scenario and now it works fine.

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

Successfully merging this pull request may close these issues.

2 participants