Skip to content

dns: better precision for Resolver timeout - #65343

Merged
nodejs-github-bot merged 4 commits into
nodejs:mainfrom
starrify:dns-sync-uv-loop-time-upon-start-timer-fix-65340
Dec 2, 2026
Merged

nodejs-github-bot merged 4 commits into
nodejs:mainfrom
starrify:dns-sync-uv-loop-time-upon-start-timer-fix-65340

Conversation

@starrify

@starrify starrify commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Changes:

3cba1b1876c test: add test case for dns Resolver for maxTimeout with tries=1
ed5f5fc97ba dns: update uv event loop time in ChannelWrap::StartTimer
d26572d7654 dns: delay the AresTimeout timer by 1 ms

Fixes: #65340

Edit: Branch force-updated to fix a typo.

Refs: nodejs#65340
Signed-off-by: Peng-Yu Chen <pengyu@libstarrify.so>
Otherwise the event loop time may be late by a considerable amount (e.g.
10~30 ms) and the timer callback would fire earlier by that amount.
Timeout processing in c-ares would then fail to recognize a timeout
until the next firing of this timer.

Fixes: nodejs#65340
Signed-off-by: Peng-Yu Chen <pengyu@libstarrify.so>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/net

@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 17, 2026
@codecov

codecov Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.53%. Comparing base (ad7a5b8) to head (3fe2c67).
⚠️ Report is 2046 commits behind head on main.

Files with missing lines Patch % Lines
src/cares_wrap.cc 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65343      +/-   ##
==========================================
+ Coverage   90.11%   90.53%   +0.42%     
==========================================
  Files         752      805      +53     
  Lines      251569   285915   +34346     
  Branches    47268    55212    +7944     
==========================================
+ Hits       226701   258860   +32159     
- Misses      16233    17161     +928     
- Partials     8635     9894    +1259     
Files with missing lines Coverage Δ
src/cares_wrap.cc 62.65% <0.00%> (-0.45%) ⬇️

... and 509 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@starrify
starrify force-pushed the dns-sync-uv-loop-time-upon-start-timer-fix-65340 branch from e75ce7d to 2000c78 Compare August 17, 2026 10:39
This is because ChannelWrap::StartTimer happens before
ares_calc_query_timeout usually by a few tens of microseconds but could
be longer. An additional allowance of 1 ms helps reduce the chance of
missing a timeout.

Fixes: nodejs#65340
Signed-off-by: Peng-Yu Chen <pengyu@libstarrify.so>
@starrify
starrify force-pushed the dns-sync-uv-loop-time-upon-start-timer-fix-65340 branch from 2000c78 to d26572d Compare August 17, 2026 10:40
@MikeMcC399 MikeMcC399 added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 27, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 27, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@MikeMcC399

This comment was marked as resolved.

by loosening the threshold from 10 ms to 100 ms
@starrify

Copy link
Copy Markdown
Contributor Author

Hi, thanks! That is reckoned as a flaky test case due to my choice of the threshold being 10 ms (expecting 1000+/-10 ms, observed 1017 ms). That may be considered understandable due to various reasons. (timer precision / system load / etc.)

Besides, a previous CI run at ed5f5fc went all green (later the branch was force-pushed only to fix a typo in comments).

I have added 3fe2c67 to reduce the flakyness (by increasing the threshold from 10 ms to 100 ms). Could you help trigger the CI again?

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@MikeMcC399 MikeMcC399 added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 30, 2026
@Ethan-Arrowood Ethan-Arrowood added the commit-queue-squash PRs the Commit Queue should land as one squashed commit. label Dec 2, 2026
@Ethan-Arrowood Ethan-Arrowood added the commit-queue PRs queued for automated landing through the Commit Queue. label Dec 2, 2026
Ethan-Arrowood added a commit to Ethan-Arrowood/agentic that referenced this pull request Dec 2, 2026
On 2026-12-02, approving nodejs/node#65343 and adding commit-queue put
its entry on hold for green CI, though its dossier showed CI=SUCCESS at
the head. Two causes, both in sync's landing gates:

- The CI gate read only cache/ci.json, which covers cq candidates. A
  fresh or re-review entry never has a row there, so its CI always
  counted as not green. It now falls back to the dossier's ci.txt,
  through the same parser the tick uses.
- An approval on a PR that already has commit-queue was held for the
  landing wait and CI. The commit queue lands it, so the entry is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nodejs-github-bot
nodejs-github-bot merged commit 434ede8 into nodejs:main Dec 2, 2026
69 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 434ede8

@nodejs-github-bot nodejs-github-bot added commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. and removed commit-queue PRs queued for automated landing through the Commit Queue. labels Dec 2, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Commit Queue failed

⚠ This PR was merged on Wed, 02 Dec 2026 19:23:15 GMT

The pull request was removed from the Commit Queue and labeled commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. . After resolving the failure, remove that label and add commit-queue PRs queued for automated landing through the Commit Queue. to retry.

Full Commit Queue output
�[36m⠋�[39m Loading data for nodejs/node/pull/65343
�[36m⠋�[39m Loading data for nodejs/node/pull/65343
�[36m⠋�[39m Getting collaborator contacts from README of nodejs/node
�[36m⠋�[39m Getting PR from nodejs/node/pull/65343
�[36m⠋�[39m Getting reviews from nodejs/node/pull/65343
�[36m⠋�[39m Getting comments from nodejs/node/pull/65343
�[36m⠋�[39m Getting commits from nodejs/node/pull/65343
✔  Done loading data for nodejs/node/pull/65343
----------------------------------- PR info ------------------------------------
Title      dns: better precision for Resolver timeout (#65343)
Author     Peng-Yu Chen <pengyu@libstarrify.so> (@starrify)
Branch     starrify:dns-sync-uv-loop-time-upon-start-timer-fix-65340 -> nodejs:main
Labels     c++, cares, author ready, needs-ci, commit-queue-squash
Commits    4
 - test: add test case for dns Resolver for maxTimeout with tries=1
 - dns: update uv event loop time in ChannelWrap::StartTimer
 - dns: delay the AresTimeout timer by 1 ms
 - test/dns: reduce flakiness in the Resolver/maxTimeout case
Committers 1
 - Peng-Yu Chen <pengyu@libstarrify.so>
PR-URL: https://github.com/nodejs/node/pull/65343
Fixes: https://github.com/nodejs/node/issues/65340
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/65343
Fixes: https://github.com/nodejs/node/issues/65340
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Mon, 17 Aug 2026 02:23:49 GMT
   ✔  Approvals: 3
   ✔  - Aviv Keller (@avivkeller): https://github.com/nodejs/node/pull/65343#pullrequestreview-5421475876
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/65343#pullrequestreview-5421836906
   ✔  - Ethan Arrowood (@Ethan-Arrowood): https://github.com/nodejs/node/pull/65343#pullrequestreview-6156936796
   ⚠  This PR was merged on Wed, 02 Dec 2026 19:23:15 GMT
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-11-29T10:13:48Z: https://ci.nodejs.org/job/node-test-pull-request/79591/
�[36m⠙�[39m Querying data for job/node-test-pull-request/79591/
�[36m⠙�[39m Querying data for job/node-test-pull-request/79591/
�[36m⠙�[39m Querying API for job/node-test-pull-request/79591/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu

View workflow run

Ethan-Arrowood added a commit to Ethan-Arrowood/agentic that referenced this pull request Dec 2, 2026
On 2026-12-02, approving nodejs/node#65343 and adding commit-queue put
its entry on hold for green CI, though its dossier showed CI=SUCCESS at
the head. Two causes, both in sync's landing gates:

- The CI gate read only cache/ci.json, which covers cq candidates. A
  fresh or re-review entry never has a row there, so its CI always
  counted as not green. It now falls back to the dossier's ci.txt,
  through the same parser the tick uses.
- An approval on a PR that already has commit-queue was held for the
  landing wait and CI. The commit queue lands it, so the entry is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ethan-Arrowood added a commit to Ethan-Arrowood/agentic that referenced this pull request Dec 3, 2026
On 2026-12-02, approving nodejs/node#65343 and adding commit-queue put
its entry on hold for green CI, though its dossier showed CI=SUCCESS at
the head. Two causes, both in sync's landing gates:

- The CI gate read only cache/ci.json, which covers cq candidates. A
  fresh or re-review entry never has a row there, so its CI always
  counted as not green. It now falls back to the dossier's ci.txt,
  through the same parser the tick uses.
- An approval on a PR that already has commit-queue was held for the
  landing wait and CI. The commit queue lands it, so the entry is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ethan-Arrowood added a commit to Ethan-Arrowood/agentic that referenced this pull request Dec 3, 2026
On 2026-12-02, approving nodejs/node#65343 and adding commit-queue put
its entry on hold for green CI, though its dossier showed CI=SUCCESS at
the head. Two causes, both in sync's landing gates:

- The CI gate read only cache/ci.json, which covers cq candidates. A
  fresh or re-review entry never has a row there, so its CI always
  counted as not green. It now falls back to the dossier's ci.txt,
  through the same parser the tick uses.
- An approval on a PR that already has commit-queue was held for the
  landing wait and CI. The commit queue lands it, so the entry is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ethan-Arrowood added a commit to Ethan-Arrowood/agentic that referenced this pull request Dec 3, 2026
…46)

* nodejs-review-bank: add bank.ts sweep and retire nodejs-review-queue

The cleanup sweep was the last thing only the queue skill had. bank.ts
sweep lists open networking PRs one label at a time, takes the oldest
batch not swept yet, and splits those whose authors went quiet for 6
months into stalled targets (external authors) and collaborator-parked
PRs. It measures the author's own last commit or comment, never
updatedAt. sweep mark records what the user did in <bank>/sweep.json,
so a PR stays out until its author pushes and then comes back as
REVIVED. The judgment steps move into SKILL.md's Cleanup sweep.

With that, nodejs-review-queue goes. The bank's description takes over
its triggers. README, agents/claude/README.md, and nodejs-contribute
point at the bank instead. The installer's prune_broken removes the
dangling ~/.claude/skills/nodejs-review-queue link on the next sync.

Closes #38.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* nodejs-review-bank: don't hold an approval the commit queue will land

On 2026-12-02, approving nodejs/node#65343 and adding commit-queue put
its entry on hold for green CI, though its dossier showed CI=SUCCESS at
the head. Two causes, both in sync's landing gates:

- The CI gate read only cache/ci.json, which covers cq candidates. A
  fresh or re-review entry never has a row there, so its CI always
  counted as not green. It now falls back to the dossier's ci.txt,
  through the same parser the tick uses.
- An approval on a PR that already has commit-queue was held for the
  landing wait and CI. The commit queue lands it, so the entry is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* nodejs-review-bank: give sessions a scratch folder outside .claude

In the slot run for nodejs/node#67851, the session couldn't write its
probe to the slot's .claude/tmp/, though its allow rule covers the
whole checkout. In dontAsk mode, Claude Code refuses writes under any
.claude/ directory. A headless run confirmed it: the same write to a
folder beside it worked.

slot acquire now creates .review-tmp/ in the slot and adds it to the
clone's info/exclude, which its worktrees share, so the folder never
makes a slot dirty. The run recipes and the session rules use it. The
copied-test recipe's require rewrite changes to ../test/ to match the
new depth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* nodejs-review-bank: show PRs whose stalled label the automation removed

On 2026-12-02 the first sweep target was nodejs/node#52176, which I'd
labeled stalled in July. github-actions removed the label about 10
hours later, so the PR stayed open, and the sweep, knowing only its own
empty ledger, listed it as new. Of the 19 PRs from that pass, 4 lost the
label: 2 because their authors came back, and #52176 and #56287 with no
author activity at all.

sweep now reads each PR's stalled label events. A PR the user labeled
whose label was removed since, with the author still silent, is listed
first as "re-label or close", with when and by whom. To find those
anywhere in the set, it fetches details for every due PR (three GraphQL
calls for 88 PRs), and --batch now limits only how many quiet PRs it
shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* nodejs-review-bank: let the sweep record a close

On 2026-12-02 I closed nodejs/node#52176 from the sweep instead of
labeling it stalled, and sweep mark had no way to record that. Closing
is often the right call: collaborators may close PRs that aren't moving,
and it's quicker for a PR whose stalled label the automation already
removed once, or for spam.

sweep mark <pr> closed records it. The sweep lists only open PRs, so a
closed one drops out, and comes back as REOPENED if it's reopened.
SKILL.md says closing is a valid outcome, and that in a review a close
needs no command, since sync reads it from GitHub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. 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. commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dns: Resolver timeout seemingly doubled upon tries=1

6 participants