Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1060050 - if stdout is redirected output is not available until build completes
Summary: if stdout is redirected output is not available until build completes
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: koji
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dennis Gilmore
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-31 09:55 UTC by Jan Stancek
Modified: 2015-06-29 14:54 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-29 14:54:00 UTC


Attachments (Terms of Use)
proposed patch (deleted)
2014-01-31 09:56 UTC, Jan Stancek
no flags Details

Description Jan Stancek 2014-01-31 09:55:44 UTC
Description of problem:
Passing output from koji to file or pipe is causing that output from koji is not available until build completes. For example, if I want to log output from "koji build" with "tee" I won't see newly created task id until build completes:

    # koji build --scratch eso-rhel-6 a.src.rpm | tee -a output.txt
    Uploading srpm: a.src.rpm
    [====================================] 100% 00:00:01 605.40 KiB 333.28 KiB/sec

<output stops here until build completes>

    Created task: 123456
    Task info: http://...?taskID=123456
    Watching tasks (this may be safely interrupted)...

Version-Release number of selected component (if applicable):
koji-1.8.0-2.fc20

How reproducible:
100%

Steps to Reproduce:
1. redirect output from "koji build" to file or pipe

Actual results:
part of output is not available until whole build completes

Expected results:
output available at import events, like: new task created, task changing state, etc.

Additional info:
proposed patch attached

Comment 1 Jan Stancek 2014-01-31 09:56:37 UTC
Created attachment 857776 [details]
proposed patch

Comment 2 Mike McLean 2014-02-26 22:58:17 UTC
This is python's buffering behavior (for non-terminals). You can disable it with python's -u option or by setting PYTHONUNBUFFERED=1 in the env. E.g.

% python -u koji build --scratch eso-rhel-6 a.src.rpm | tee -a output.txt

% PYTHONUNBUFFERED=1 koji build --scratch eso-rhel-6 a.src.rpm | tee -a output.txt

Comment 3 Jan Stancek 2014-02-27 07:45:29 UTC
(In reply to Mike McLean from comment #2)
> This is python's buffering behavior (for non-terminals). You can disable it
> with python's -u option or by setting PYTHONUNBUFFERED=1 in the env. E.g.
> 
> % python -u koji build --scratch eso-rhel-6 a.src.rpm | tee -a output.txt
> 
> % PYTHONUNBUFFERED=1 koji build --scratch eso-rhel-6 a.src.rpm | tee -a
> output.txt

Sure, but it would be nice if users of koji didn't have to deal with this.

Comment 4 Mike McLean 2014-02-28 20:34:43 UTC
Hmm. I'm not sure of this is the right approach. I'm wondering if we should just disable output buffering in the cli entirely.

Otoh, this patch is simple and harmless, so I guess it will do at least as an interim measure.

Comment 5 Mike McLean 2014-02-28 20:54:40 UTC
I've made the change upstream. Different locations for the flushes though.

https://git.fedorahosted.org/cgit/koji/commit/?id=257dd238f88c864bc189c2dc41b8a7ddf0e1bc24

I believe we're expecting a new build of Koji in Fedora fairly soon, and this should be included.

Comment 6 Fedora End Of Life 2015-05-29 10:45:18 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2015-06-29 14:54:00 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.