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
Created attachment 857776 [details] proposed patch
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
(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.
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.
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.
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.
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.