Skip to content

Retry IDNA table allocation after a transient failure - #108

Merged
lemire merged 1 commit into
mainfrom
retry-table-alloc
Oct 14, 2026
Merged

lemire merged 1 commit into
mainfrom
retry-table-alloc

Conversation

@anonrig

@anonrig anonrig commented Oct 14, 2026

Copy link
Copy Markdown
Member

Mirror of ada-url/ada#1322 (same change to the vendored copy in src/ada_idna.cpp).

ensure_tables() used to store a permanent failure when new (std::nothrow) could not allocate the table buffer, so every later IDNA call in the process failed even after memory became available.

An allocation failure now stores the uninitialized state and returns false, so a later call can take the init slot again. A checksum or inflate mismatch still stores the permanent failure. A thread waiting on a peer that abandoned an allocation returns immediately instead of spinning until the timeout.

Refs ada-url/ada#1305

@lemire lemire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine but it would probably do nothing in practice. In Node.js, it is likely that an out of memory is just an halt which would be correct.

@lemire
lemire merged commit 576dbc8 into main Oct 14, 2026
35 checks passed
@lemire
lemire deleted the retry-table-alloc branch October 14, 2026 23:13
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