fix: add timeout handling to registryValidation to prevent CLI hang#2096
fix: add timeout handling to registryValidation to prevent CLI hang#2096TeapoyY wants to merge 1 commit intoasyncapi:masterfrom
Conversation
When --registry-url points to an unreachable host, the CLI would hang indefinitely due to fetch() having no timeout. This fix: - Adds AbortController with a 5-second timeout - Uses clearTimeout to avoid memory leaks on successful fetch - Provides a clear error message when timeout occurs - Properly propagates the original error when fetch fails for other reasons Fixes asyncapi#2027
|
|
|
@TeapoyY, please read asyncapi/community#2295 (comment). Note that #2039 is already assigned and participates in a mutex-like Bounty Program: pull requests from GitHub users other than the assigned Bounty Program Participant will not be reviewed. This Bounty Issue is assigned via two mechanisms:
You are welcome to choose another GitHub issue to contribute to. |



When --registry-url points to an unreachable host, the CLI would hang indefinitely due to fetch() having no timeout.
Changes
Testing
Tested manually with unreachable registry URL (blackholed IP):
\
asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template --registry-url http://10.255.255.1
\
Expected: CLI fails fast with timeout error message
Before: CLI hangs indefinitely
Fixes #2027