Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 478842 - Make emerge whine when fetch fails (even in quiet mode)
Summary: Make emerge whine when fetch fails (even in quiet mode)
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 377365
  Show dependency tree
 
Reported: 2013-07-30 16:27 UTC by Alexander Berntsen (RETIRED)
Modified: 2013-07-30 17:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Berntsen (RETIRED) gentoo-dev 2013-07-30 16:27:56 UTC
I think that emerge should whine at me when fetching fails. This behaviour should be default, even in quiet mode. A parameter could control it.

Backstory:
For some seemingly random packages, emerge spent up to three hours doing seemingly nothing. I have know figured it out and fixed the problem. The problem was that my mirror has apparently died on me, and so fetching was not exactly working. If emerge had whined at me, I would have spotted this at once. (Arguably I would have spotted it at once if I were running tail -f /var/log/emerge-fetch.log as well, but then again I'm lazy.)
Comment 1 Zac Medico gentoo-dev 2013-07-30 16:37:24 UTC
We could use different parameters to control behavior for different modes of failure. For example, checksum failures are probably the most common mode of failure that you would be interested in.

If it's an issue with the mirror timing out, I don't think there's much we can do there, since generally a human has to tail -f /var/log/emerge-fetch.log in order to detect that kind of thing.
Comment 2 Alexander Berntsen (RETIRED) gentoo-dev 2013-07-30 16:42:47 UTC
We can have an argument for when to timeout, and also when to warn. So you could set WARN_ME_WHEN to 120, and if nothing happens it 120 secs, emerge says "mirror foo is taking suspiciously long...", and then sett FAIL_WHEN to 240 and automatically die when 240 secs have gone.
Comment 3 Zac Medico gentoo-dev 2013-07-30 16:47:20 UTC
(In reply to Alexander Berntsen from comment #2)
> We can have an argument for when to timeout, and also when to warn. So you
> could set WARN_ME_WHEN to 120, and if nothing happens it 120 secs, emerge
> says "mirror foo is taking suspiciously long...", and then sett FAIL_WHEN to
> 240 and automatically die when 240 secs have gone.

But, we don't want it to bail out early if the download is large relative to the connection speed. I wonder if there are some wget options for this. Since portage simply executes FETCHCOMMAND, it's not really possible for portage to monitor progress, unless we replace FETCHCOMMAND with python library calls.
Comment 4 Alexander Berntsen (RETIRED) gentoo-dev 2013-07-30 16:51:00 UTC
wget has -T, which is the network timeout in seconds. It also has --dns-timout, --connect-timout and --read-timeout.

Is it not possible though to check the downloaded file at WARN_WHEN and FAIL_WHEN? i.e. something has been downloaded, at all ? well all right then : WARN/FAIL.
Comment 5 Zac Medico gentoo-dev 2013-07-30 16:53:23 UTC
(In reply to Alexander Berntsen from comment #4)
> Is it not possible though to check the downloaded file at WARN_WHEN and
> FAIL_WHEN? i.e. something has been downloaded, at all ? well all right then
> : WARN/FAIL.

Actually, yes, it would be possible for portage to monitor the file size.
Comment 6 Zac Medico gentoo-dev 2013-07-30 17:19:11 UTC
There's some example code in pym/portage/tests/ebuild/test_ipc_daemon.py the would serve as a good starting point for monitoring the file size. You would use SpawnProcess to spawn FETCHCOMMAND, and replace EbuildIpcDaemon with a different class that monitors the file size.