Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 544098 - sys-apps/portage-2.2.18: parallel emerge should not display error logs!
Summary: sys-apps/portage-2.2.18: parallel emerge should not display error logs!
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-22 12:47 UTC by Klaus Kusche
Modified: 2015-03-26 20:47 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 Klaus Kusche 2015-03-22 12:47:49 UTC
Up to now, emerge --jobs=... --keep-going ...
only displayed error summaries and the file names of the detailled error logs.

Now, it displays the whole error log file contents on the terminal.
This is a very bad idea, please revert to the old behaviour immediately!

Reason:
Displaying the complete error log files (which may be several 10000 lines)
scrolls all the important informations off the terminal.

One no longer sees
* how many and which packages were actually emerged successfully
* how many and which packages actually failed
  (because only the detailled error log of the last failing package
  remains visible, all error messages of packages which failed before
  are scrolled off the scrollback buffer)
  This is especially bad if emerge failures are caused by earlier failures:
  One only sees the subsequential failure, 
  not the one initially causing the trouble.
* and some other informations and summaries given by emerge.
Comment 1 Zac Medico gentoo-dev 2015-03-26 00:50:32 UTC
The behavior has not changed recently, but it depends on the number of failures. It only displays the error log on the terminal if there is exactly 1 failure. You can change the behavior by setting EMERGE_DEFAULT_OPTS="--quiet-fail" in make.conf.

*** This bug has been marked as a duplicate of bug 440982 ***
Comment 2 Klaus Kusche 2015-03-26 08:26:37 UTC
Something has definitely changed, I don't know what.

I have used "--jobs=4 --keep-going" for years, and emerge *never* showed
any error logs until recently, even in case of just one error 
(I do weekly emerges, and I'm on ~amd64, sometimes with some overlays, 
so I had errors quite often).

Now (for one or two months), emerge *always* seems to show error logs.
I don't know if one or several logs, and I don't know what happened
before displaying the log (how many emerge errors, ...), 
because all that was scrolled off the scrollback buffer.

Just a wild guess, from looking at the packages which were emerged / not emerged:
Perhaps "--keep-going" no longer works or is ignored. After errors in 
"emerge --deep --update --newuse --keep-going --jobs=4 @world @system", 
recently a lot of un-emerged packages remained, far more than usual,
and I havn't seen any "recalculating dependencies" messages 
and emerge restarts after errors recently. 
Could be just some bad luck or a change in behaviour.

Of course, if "--keep-going" fails, there will always be *exactly one* error,
no more, and according to what you said below, it will be displayed.
As long as "--keep-going" works, the final emerge restart will *always* end
with *zero* errors (in the simplest case with no emergeable packages remaining),
hence no logs were displayed, even if there were errors before.
Comment 3 Zac Medico gentoo-dev 2015-03-26 17:42:41 UTC
(In reply to Klaus Kusche from comment #2)
> Something has definitely changed, I don't know what.

You can see the code for portage-2.2.18 here:

http://gitweb.gentoo.org/proj/portage.git/tree/pym/_emerge/Scheduler.py?h=v2.2.18#n1084

As you can see, the logic there hasn't changed since --quiet-fail was added in this commit:

http://gitweb.gentoo.org/proj/portage.git/commit/?id=c74a19691f5cbc0ec070d5fd4ffe1983bde05a09

> I have used "--jobs=4 --keep-going" for years, and emerge *never* showed
> any error logs until recently, even in case of just one error 
> (I do weekly emerges, and I'm on ~amd64, sometimes with some overlays, 
> so I had errors quite often).

That's interesting, but I don't know what to say, given that the code hasn't changed.

> Now (for one or two months), emerge *always* seems to show error logs.
> I don't know if one or several logs, and I don't know what happened
> before displaying the log (how many emerge errors, ...), 
> because all that was scrolled off the scrollback buffer.
> 
> Just a wild guess, from looking at the packages which were emerged / not
> emerged:
> Perhaps "--keep-going" no longer works or is ignored. After errors in 
> "emerge --deep --update --newuse --keep-going --jobs=4 @world @system", 
> recently a lot of un-emerged packages remained, far more than usual,
> and I havn't seen any "recalculating dependencies" messages 
> and emerge restarts after errors recently. 
> Could be just some bad luck or a change in behaviour.

The --keep-going behavior depends very much on the state of the dependencies on your system. We have a number of bugs reported for it, tracked by bug 373807.

> Of course, if "--keep-going" fails, there will always be *exactly one* error,
> no more, and according to what you said below, it will be displayed.
> As long as "--keep-going" works, the final emerge restart will *always* end
> with *zero* errors (in the simplest case with no emergeable packages
> remaining),
> hence no logs were displayed, even if there were errors before.

I'm not sure about the meaning of your statements here. With --keep-going, you can have any number of failures. If you want consistent behavior regardless of the number of failures, then you need to use --quiet-fail.
Comment 4 Klaus Kusche 2015-03-26 18:34:54 UTC
> > Of course, if "--keep-going" fails, there will always be *exactly one* error,
> > no more, and according to what you said below, it will be displayed.
> > As long as "--keep-going" works, the final emerge restart will *always* end
> > with *zero* errors (in the simplest case with no emergeable packages
> > remaining),
> > hence no logs were displayed, even if there were errors before.
> 
> I'm not sure about the meaning of your statements here. With --keep-going,
> you can have any number of failures. If you want consistent behavior
> regardless of the number of failures, then you need to use --quiet-fail.

Well, if "--keep-going" fails for whatever bug, 
i.e. the first error stops the emerge, 
then you will always have exactly one error, 
which causes the log to be displayed
(which could explain the behavior I see now).

If --keep-going works, the question is 
if the error counter used for the "display the log" decision
is the total error count or just the error count since 
the last recalculation of dependencies and restart of the emerge
(caused by --keep-going after an error occurred). 

Of course, the error count since the last restart is *always* zero,
because either there are no more emergeable packages (= also no fails),
or the packages remaining after the error have all been emerged sucessfully
(otherwise, there would be another restart).

So, if for some reason the error count got reset whenever --keep-going
restarted the emerge after an error, emerge will *never* display any logs, 
even if there was exactly one error in total.
This could explain the behaviour I've seen before (no logs at all, never).

This is consistent with the status output continuously displayed by emerge, 
because after a restart caused by --keep-going after an error,
not only the total number of packages to emerge and the number of packages
already emerged was reset, but also the number of failed packages displayed
was reset to 0 if I remember correctly.

If this was indeed the case, and this was "fixed" now to use the total number
of failures instead, it would explain the change in behaviour I observed.
Comment 5 Zac Medico gentoo-dev 2015-03-26 20:32:28 UTC
(In reply to Klaus Kusche from comment #4)
> Well, if "--keep-going" fails for whatever bug, 
> i.e. the first error stops the emerge, 
> then you will always have exactly one error, 
> which causes the log to be displayed
> (which could explain the behavior I see now).

Not necessarily, because it might re-calculate one or more times before that, and there is at least one failure for each re-calculation.

> If --keep-going works, the question is 
> if the error counter used for the "display the log" decision
> is the total error count or just the error count since 
> the last recalculation of dependencies and restart of the emerge
> (caused by --keep-going after an error occurred). 

It is the total error count, measured by the _failed_pkgs_all variable.

> Of course, the error count since the last restart is *always* zero,
> because either there are no more emergeable packages (= also no fails),
> or the packages remaining after the error have all been emerged sucessfully
> (otherwise, there would be another restart).

Right, this is why the error count since the last restart does not matter, and it is not used for anything except the "number of failed packages" display which you mention below.

> So, if for some reason the error count got reset whenever --keep-going
> restarted the emerge after an error, emerge will *never* display any logs, 
> even if there was exactly one error in total.
> This could explain the behaviour I've seen before (no logs at all, never).

In the code, I don't see any evidence to support this theory.

> This is consistent with the status output continuously displayed by emerge, 
> because after a restart caused by --keep-going after an error,
> not only the total number of packages to emerge and the number of packages
> already emerged was reset, but also the number of failed packages displayed
> was reset to 0 if I remember correctly.

Yeah, that "number of failed packages" counter resets for each re-calculation. This doesn't affect the _failed_pkgs_all variable, though.

> If this was indeed the case, and this was "fixed" now to use the total number
> of failures instead, it would explain the change in behaviour I observed.

No, it was never "fixed", because it always used the _failed_pkgs_all variable as it does now.
Comment 6 Klaus Kusche 2015-03-26 20:47:23 UTC
Ok, then it really seems to be just strange coincidents on my side
which should be solved by --quiet-fail anyway.

Closed as long as I can't clearly reproduce obvious misbehaviour.