Repository navigation
Make getaddrinfo an asynchronous lookup with promise and callback variants - #27881
Open
guybedford wants to merge 1 commit into
Open
guybedford wants to merge 1 commit into
guybedford wants to merge 1 commit into
Conversation
guybedford
added this pull request to stack #27882
October 6, 2026 01:24
guybedford
marked this pull request as ready for review
October 6, 2026 01:25
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 6, 2026 01:46
60802ee to
d7f6ab7
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 6, 2026 18:33
d7f6ab7 to
975d63e
Compare
guybedford
removed this pull request from stack #27882
October 6, 2026 19:38
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 6, 2026 19:38
975d63e to
4503f39
Compare
guybedford
added this pull request to stack #27894
October 6, 2026 19:38
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 6, 2026 20:39
4503f39 to
bd763ab
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
2 times, most recently
from
October 7, 2026 01:11
41c1fe6 to
4048dcd
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 7, 2026 02:08
4048dcd to
8afb413
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 7, 2026 06:40
8afb413 to
68a3587
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 7, 2026 19:32
68a3587 to
ea6f868
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 7, 2026 23:17
ea6f868 to
2a12274
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 7, 2026 23:43
2a12274 to
dbd86e5
Compare
guybedford
removed this pull request from stack #27894
October 8, 2026 00:03
guybedford
changed the base branch from
gbedford/async-canwait
to
gbedford/fd-form
October 8, 2026 00:03
guybedford
added this pull request to stack #27923
October 8, 2026 00:03
guybedford
force-pushed
the
gbedford/dns-forms
branch
2 times, most recently
from
October 9, 2026 16:56
646efed to
cd1a59d
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
2 times, most recently
from
October 12, 2026 23:15
a264576 to
1034feb
Compare
guybedford
removed this pull request from stack #27923
October 12, 2026 23:15
guybedford
changed the base branch from
gbedford/fd-form
to
gbedford/callback-form
October 12, 2026 23:15
guybedford
added this pull request to stack #27955
October 12, 2026 23:15
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 12, 2026 23:25
1034feb to
b7e972b
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 12, 2026 23:39
b7e972b to
e9f85ce
Compare
guybedford
removed this pull request from stack #27955
October 12, 2026 23:39
guybedford
added this pull request to stack #27957
October 12, 2026 23:40
guybedford
removed this pull request from stack #27957
October 12, 2026 23:40
guybedford
added this pull request to stack #27958
October 12, 2026 23:41
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 13, 2026 00:28
e9f85ce to
7db881d
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 13, 2026 00:30
7db881d to
77a780b
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 13, 2026 00:35
77a780b to
07bca5f
Compare
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 14, 2026 23:21
07bca5f to
9457279
Compare
…iants emscripten_dns_lookup(node, service, hints) is the getaddrinfo body as one __async: ['promise', 'callback'] function: it resolves to a newly allocated addrinfo list (or a negative EAI_* code), synchronously for numeric addresses and errors, and under NODERAWSOCKETS after a node:dns lookup for a hostname, or EAI_AGAIN where the caller cannot wait. getaddrinfo() itself becomes a C wrapper over it; the hand-written dispatch goes away. emscripten_dns_lookup_promise() and emscripten_dns_lookup_callback() are its variants, so a real DNS lookup can be awaited without blocking from any stack: as an em_promise_t, or a callback on the calling thread.
guybedford
force-pushed
the
gbedford/dns-forms
branch
from
October 14, 2026 23:51
9457279 to
5eaf9ea
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
emscripten_dns_lookup(node, service, hints)is thegetaddrinfobody as one__async: ['promise', 'callback']function: it resolves to a newly allocatedaddrinfolist (or a negativeEAI_*code), synchronously for numeric addresses and errors, and underNODERAWSOCKETSafter anode:dnslookup for a hostname, orEAI_AGAINwheresyncsays the caller cannot wait.getaddrinfo()itself becomes a C wrapper over it; its hand-written ASYNCIFY/pthread dispatch goes away.emscripten_dns_lookup_promise()andemscripten_dns_lookup_callback()are its_promiseand_callbackvariants, so a real DNS lookup can be awaited without blocking from any stack: as anem_promise_t, or throughcallback(err, result, arg)on the calling thread (erris never set: a failed lookup is anEAI_*result). All three are declared inemscripten.h, sogen_sig_infogenerates their signatures as usual. Supersedes #27742.Tests:
other.test_dns_lookup_async,sockets_node.test_noderawsockets_dns_async(withPROXY_TO_PTHREAD); existinggetaddrinfotests unchanged.Made with AI assistance under my review