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

dns: fix uv_timer_start usage #39723

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

oluan
Copy link
Contributor

@oluan oluan commented Aug 10, 2021

While implementing tests for new option tries on Resolver I noticed that it took at least 900ms more than it should when the timeout was > 1000.

So a 1000ms timeout would actually take ~1900ms to trigger.

The reason is that the wrapper would register a timer in which callback interval and timeout was 1000ms in this case, which caused the callback to fire only after this timeout, leading to one more interval of waiting to be fired again.

In addition, this also adds missing tests for the option tries!

Refs: #39610 #39562

This commit fixes `uv_timer_start` usage on `ChannelWrap::StartTimer`,
implements more precise timeout checking and missing tests for the
`tries` option.
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. needs-ci PRs that need a full CI run. labels Aug 10, 2021
@Trott
Copy link
Member

Trott commented Aug 10, 2021

@nodejs/dns

@oluan
Copy link
Contributor Author

oluan commented Aug 10, 2021

Any idea why the coverage-linux is failing?

nvm, just saw #39725

src/cares_wrap.cc Outdated Show resolved Hide resolved
@addaleax
Copy link
Member

@nodejs/dns

@aduh95
Copy link
Contributor

aduh95 commented Sep 20, 2023

Ping @nodejs/dns for reviews

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants