Bug 1418386

Summary: sometimes parallel builds start before serial builds complete with policy change to parallel
Product: OKD Reporter: Aleksandar Kostadinov <akostadi>
Component: BuildAssignee: Ben Parees <bparees>
Status: CLOSED CURRENTRELEASE QA Contact: Wenjing Zheng <wzheng>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.xCC: aos-bugs, haowang, mifiedle, wsun, xtian
Target Milestone: ---   
Target Release: 3.x   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: online_3.4.1
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-10 21:34:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Aleksandar Kostadinov 2017-02-01 17:16:26 UTC
Description of problem:
Sometimes builds are run out of order.

> $  oc get builds --namespace=03d3u
> NAME                 TYPE      FROM          STATUS      STARTED              DURATION
> ruby-hello-world-1   Source    Git@e79d887   Cancelled   6 minutes ago        23s
> ruby-hello-world-2   Source    Git@e79d887   Cancelled   4 minutes ago        12s
> ruby-hello-world-3   Source    Git           New                              
> ruby-hello-world-4   Source    Git@e79d887   Running     About a minute ago   1m56s
> ruby-hello-world-5   Source    Git@e79d887   Running     About a minute ago   1m53s
> ruby-hello-world-6   Source    Git@e79d887   Running     About a minute ago   1m57s

Version-Release number of selected component (if applicable):
STG 3.4.1.2

How reproducible:
often

Steps to Reproduce:
1. oc new-build openshift/ruby~https://github.com/openshift/ruby-hello-world
2. oc start-build bc/ruby-hello-world # 3 times
3. oc patch bc/ruby-hello-world -p '{"spec":{"runPolicy":"Parallel"}}'
4. oc start-build bc/ruby-hello-world # 3 times
5. oc get build -w

Actual results:
see above, parallel builds may kick in before a serial build

Expected results:
parallel builds wait for serial builds to complete

Comment 1 Aleksandar Kostadinov 2017-02-01 17:28:03 UTC
Actually I could not reproduce when builds execute and complete normally. If after step #4 though, I issue the command

> oc cancel-build ruby-hello-world-1

then builds could end up like:

> NAME                 TYPE      FROM          STATUS	 STARTED	  DURATI
ON
> ruby-hello-world-1   Source    Git@e79d887   Cancelled   2 minutes ago    36s
> ruby-hello-world-2   Source    Git           New
> ruby-hello-world-3   Source    Git           New
> ruby-hello-world-4   Source    Git           Pending
> ruby-hello-world-5   Source    Git           Pending
> ruby-hello-world-6   Source    Git@e79d887   Running     10 seconds ago   9s

So it appears to be related to canceling build. Or that just makes it easier to reproduce. If the issue does not manifest after canceling first build, then it can manifest after second build is canceled.

Comment 2 Ben Parees 2017-02-01 19:58:33 UTC
This was fixed by https://github.com/openshift/origin/pull/12699

Comment 4 Aleksandar Kostadinov 2017-07-06 13:49:33 UTC
Can't reproduce anymore with v3.6.135