Summary: | [patch] bsdinstall(8): when distfile fetch is complete on some distfiles, but not entire set, progress can go over 100%; installer gets confused with distfiles and halts | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Enji Cooper <ngie> | ||||||
Component: | bin | Assignee: | Alfonso S. Siciliano <asiciliano> | ||||||
Status: | Open --- | ||||||||
Severity: | Affects Only Me | CC: | asiciliano, grahamperrin, tom | ||||||
Priority: | Normal | Keywords: | install, patch | ||||||
Version: | 9.0-RELEASE | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Enji Cooper
2012-07-09 20:30:17 UTC
Responsible Changed From-To: freebsd-bugs->freebsd-sysinstall Over to maintainer(s). The attached patch goes beyond what the previous patch did in the following ways: 1. Catch errors and terminate whenever a failure occurs. 2. Catch more user errors with undefined environment variables. 3. Catch memory allocation errors. 4. Convert fprintf+return calls to err*(3)/warnx(3) calls. 5. Reorder error handling to avoid potentially confusing mangling via dialog(3). Thanks, -Garrett For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped + if (fetchStatURL(urls[i], &ustat, "") == -1) { + snprintf(errormsg, sizeof(errormsg), + "Error while determining file size for %s: %s\n", + urls[i], fetchLastErrString); + items[i*2 + 1] = "Failed"; + dialog_msgbox("Fetch Error", errormsg, 0, 0, + TRUE); + return (-1); + } I'd suggest it best here just to quietly reset total_bytes = 0 and abort trying to get the sizes up-front. HEAD requests failing isn't fatal, the code can fall back to just calculating percentage from the number of files. I've seen this sort of thing more than once: https://www.reddit.com/r/freebsd/comments/g7gdc9/is_that_normal_overall_progress_208/ i.e. *only* the first fetchStatURL() failed. Resetting total_bytes to 0 would have left them with a functional but coarse-grained total progress bar, while this patch would have errored out the entire operation. Same problem some day ago with CURRENT 14, it is an easily reproducible error, review D33978 A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=55af0f96d0fb92e49fad0c63e7b062c419197459 commit 55af0f96d0fb92e49fad0c63e7b062c419197459 Author: Alfonso S. Siciliano <asiciliano@FreeBSD.org> AuthorDate: 2022-02-23 00:54:51 +0000 Commit: Alfonso S. Siciliano <asiciliano@FreeBSD.org> CommitDate: 2022-02-23 00:54:51 +0000 bsdinstall/distfetch: fix main bar percentage with errors UI fix not related to the real fetching process, use 'nfiles' (instead of 'total files size') to compute main bar percentage if an error occurs: - fix: main bar greater than 100%, if an error occurs before fetching - fix: main bar less than 100%, if an error occurs during fetching - add: last mixedgauge, at least one dialog if a total failure occurs PR: 164094, 169748 Approved by: bapt (mentor) Review: https://reviews.freebsd.org/D33978 usr.sbin/bsdinstall/distfetch/distfetch.c | 33 ++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi> |