Skip to content

fix: add 10s timeout to registry URL validation to prevent CLI hang#2059

Open
zhaog100 wants to merge 1 commit intoasyncapi:masterfrom
zhaog100:fix/registry-url-timeout
Open

fix: add 10s timeout to registry URL validation to prevent CLI hang#2059
zhaog100 wants to merge 1 commit intoasyncapi:masterfrom
zhaog100:fix/registry-url-timeout

Conversation

@zhaog100
Copy link

Problem

When --registry-url points to an unreachable host, the CLI hangs indefinitely because fetch() has no timeout.

Solution

Add AbortController with a 10-second timeout to registryValidation(). On timeout, the CLI now fails fast with a clear error:

Registry URL timed out after 10s: <url>

Fixes #2027

When --registry-url points to an unreachable host, the CLI would hang
indefinitely waiting for the fetch request. This adds an AbortController
with a 10-second timeout to registryValidation() so the CLI fails fast
with a clear error message.

Fixes asyncapi#2027
@changeset-bot
Copy link

changeset-bot bot commented Mar 19, 2026

⚠️ No Changeset found

Latest commit: 7ea57d3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

[BUG] CLI hangs indefinitely when --registry-url points to an unreachable host (no timeout handling)

1 participant