RedHatSatellite / katello-cvmanager

manage Katello content views
GNU General Public License v2.0
49 stars 31 forks source link

sequential 4 seems to delay log output #41

Closed pcfe closed 6 years ago

pcfe commented 7 years ago

the promote action seems to output it's logs delayed when using :sequential: 4 in cvmanager.yaml

steps to reproduce:

  1. use a cvmanager (git pull-ed 2017-09-12)

  2. set :sequential: 4 in cvmanager.yaml

  3. have some (about 18 in this case) CCV to promote defined in cvmanager.yaml

  4. have time ./cvmanager --wait promote --to-lifecycle-environment 30 in a wrapper script (cvauto.sh also calls time ./cvmanager --wait publish and time ./cvmanager --wait update plus some other non-cvmanager commands)

  5. /root/katello-cvmanager/cvauto.sh | tee /root/katello-cvmanager/cvauto_$(date +"%Y-%m-%d_%H-%M-%S").log

  6. try to follow a Satellite task in the webUI by gettng it's ID from the cvmanager output

actual result:

Tasks get scheduled and executed in batches of 4 as intended. But I can follow Synchronize repository … Tasks in the Satellite webUI way before they show up in the shell. Some may finish before I see them in the cvmanager output e.g. 2df778d3-e553-4c36-8bc1-befd0a36bac8 ran as follows:

Started at: 2017-09-12 18:56:40 UTC
Ended at: 2017-09-12 19:11:04 UTC 

but in the tee I saw it only some time after 19:16 UTC

What I get is long period of silence and when there is output it's about many tasks followed by another long (double digit minutes) period of silence.

expected result:

seeing output like the following around the time the tasks are queued, not many minutes later.

Inspecting ccv-demo-rhel6-qpid
 Promoting latest version to lifecycle-environment 30
waiting 10 for pending tasks: ["b552cc77-173b-4ea9-b4d2-27d882dd42bf"]
waiting 20 for pending tasks: ["b552cc77-173b-4ea9-b4d2-27d882dd42bf"]

addition info:

evgeni commented 6 years ago

tee buffers input

see https://stackoverflow.com/questions/11337041/force-line-buffering-of-stdout-when-piping-to-tee and https://unix.stackexchange.com/questions/25372/turn-off-buffering-in-pipe :)