Brigade: Age misreported

Created on 17 Aug 2018  路  4Comments  路  Source: brigadecore/brigade

01cn4v4qh8d2rdnw20z6et3qvh  pull_request    github      brigade-596ea562fb96e52ff3c8504319f876d779558a87b4dc3e266caaee  Pending     292y

This is using 0.17.0 and an entry found on brig build list

It's a couple seconds old rather than 292y.

bug

Most helpful comment

TL;DR: it's showing wrong time duration because Pod is either being scheduled/creating/running and so its containerStatuses[0].State.Terminated.FinishedAt.Time has a wrong value.

Managed to repro myself.

dgkanatsios@digkanat:~$ brig build list
ID                              TYPE    PROVIDER        PROJECT                                                         STATUS          AGE
01cxg7t1qzscnkv91n0w1v97xw      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       5m
01cxg81x4adh9hfnzbax5h7jg2      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       59s
01cxg83y5vp52d5eax305h64z0      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Running         292y
dgkanatsios@digkanat:~$ brig build list
ID                              TYPE    PROVIDER        PROJECT                                                         STATUS          AGE
01cxg7t1qzscnkv91n0w1v97xw      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       5m
01cxg81x4adh9hfnzbax5h7jg2      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       1m
01cxg83y5vp52d5eax305h64z0      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       5s

So, build list shows worker.EndTime in the Age column. The only place that this field is set is here and then get converted to seconds here

We could tackle it this way, use the following code here:

if b.Worker.Status == brigade.JobSucceeded || b.Worker.Status == brigade.JobFailed {
    since = duration.ShortHumanDuration(time.Since(b.Worker.EndTime))
}

Thoughts?

All 4 comments

Does it fix itself shortly afterward? I momentarily saw this, and am wondering if the creation timestamp is being initialized to one value, then updated shortly after.

Until the status is updated to something, other than than the initial status, the date is wrong.

TL;DR: it's showing wrong time duration because Pod is either being scheduled/creating/running and so its containerStatuses[0].State.Terminated.FinishedAt.Time has a wrong value.

Managed to repro myself.

dgkanatsios@digkanat:~$ brig build list
ID                              TYPE    PROVIDER        PROJECT                                                         STATUS          AGE
01cxg7t1qzscnkv91n0w1v97xw      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       5m
01cxg81x4adh9hfnzbax5h7jg2      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       59s
01cxg83y5vp52d5eax305h64z0      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Running         292y
dgkanatsios@digkanat:~$ brig build list
ID                              TYPE    PROVIDER        PROJECT                                                         STATUS          AGE
01cxg7t1qzscnkv91n0w1v97xw      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       5m
01cxg81x4adh9hfnzbax5h7jg2      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       1m
01cxg83y5vp52d5eax305h64z0      exec    brigade-cli     brigade-370f96797fcc5bebdfe76f919cf8c6e8b3c254b671889867ed08db  Succeeded       5s

So, build list shows worker.EndTime in the Age column. The only place that this field is set is here and then get converted to seconds here

We could tackle it this way, use the following code here:

if b.Worker.Status == brigade.JobSucceeded || b.Worker.Status == brigade.JobFailed {
    since = duration.ShortHumanDuration(time.Since(b.Worker.EndTime))
}

Thoughts?

I'd be :100: with that fix.

Was this page helpful?
0 / 5 - 0 ratings