Skip to content

Don't panic when somebody else's version index is down - #306

Merged
eirikb merged 2 commits into
mainfrom
feature/eirikb/no-panic-on-dead-index
Jul 29, 2026
Merged

Don't panic when somebody else's version index is down#306
eirikb merged 2 commits into
mainfrom
feature/eirikb/no-panic-on-dead-index

Conversation

@eirikb

@eirikb eirikb commented Jul 29, 2026

Copy link
Copy Markdown
Owner

CI lost an afternoon to this: unofficial-builds.nodejs.org went away for a few hours and the alpine job died with a hyper_util panic, which reads like a bug in gg. It wasn't, and three re-runs later it still wasn't. That is the same shape as the report in #272.

New fetch.rs wraps the GET: fetch_text/fetch_json hand back None instead of unwrapping, and warn with the URL and the reason. Warn is the default level, so you get the real cause without knowing to pass -v. The client also has connect and request timeouts - a host that swallows packets used to leave gg spinning forever, which is worse than the panic it replaced - and error_for_status, or a 503 holding page is just a body the scrapers quietly parse zero links out of.

node, go, gradle, rat, maven and azul go through it now. prep no longer panics with "Did not find any download URL!" either; it says which tool and that the list may be unreachable, with the warning above it carrying the detail.

Two places were quietly turning a dead index into good news. update reported "All tools are up to date!" and exit 0 when it could not read a single version list, so check_tool_update now separates "could not check" from "nothing newer". And update -u for all tools deleted the cache dir, dropped prep's Err on the floor and printed "Successfully updated" - the single-tool path already knew better, the all-tools path did not.

Still panics past this point: a 404 asset or a truncated archive dies in bloody_indiana_jones, and about eight other fetch sites are still hand-rolled and silent. Those are for later.

CI lost an afternoon to this: unofficial-builds.nodejs.org went away for a few
hours and the alpine job died with a hyper_util panic, which reads like a bug in
gg. It wasn't, and three re-runs later it still wasn't. That is the same shape as
the report in #272.

New fetch.rs wraps the GET: fetch_text/fetch_json hand back None instead of
unwrapping, and warn with the URL and the reason. Warn is the default level, so
you get the real cause without knowing to pass -v. The client also has connect
and request timeouts - a host that swallows packets used to leave gg spinning
forever, which is worse than the panic it replaced - and error_for_status, or a
503 holding page is just a body the scrapers quietly parse zero links out of.

node, go, gradle, rat, maven and azul go through it now. prep no longer panics
with "Did not find any download URL!" either; it says which tool and that the
list may be unreachable, with the warning above it carrying the detail.

Two places were quietly turning a dead index into good news. `update` reported
"All tools are up to date!" and exit 0 when it could not read a single version
list, so check_tool_update now separates "could not check" from "nothing newer".
And `update -u` for all tools deleted the cache dir, dropped prep's Err on the
floor and printed "Successfully updated" - the single-tool path already knew
better, the all-tools path did not.

Still panics past this point: a 404 asset or a truncated archive dies in
bloody_indiana_jones, and about eight other fetch sites are still hand-rolled
and silent. Those are for later.
@eirikb
eirikb enabled auto-merge (squash) July 29, 2026 07:58
test_fetch_text_returns_the_body_on_200 got None on windows-latest. Closing a
socket while the request is still sitting unread gets you an RST there, and the
response we just wrote goes out with it - so the client saw a broken connection
instead of the body.

The other two one_shot_server tests were green, but only because they expect
None either way. That test was the only one that could notice.
@eirikb
eirikb merged commit c0ad796 into main Jul 29, 2026
177 checks passed
@eirikb
eirikb deleted the feature/eirikb/no-panic-on-dead-index branch July 29, 2026 08:40
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.

1 participant