lsergio commented on code in PR #5757:
URL: https://github.com/apache/camel-k/pull/5757#discussion_r1713588914


##########
pkg/apis/camel/v1/build_types_support.go:
##########
@@ -311,10 +332,27 @@ func (bl BuildList) HasMatchingBuild(build *Build) (bool, 
*Build) {
                                // additionally check for the creation timestamp
                                if 
b.CreationTimestamp.Before(&build.CreationTimestamp) {
                                        return true, &b
+                               } else if 
b.CreationTimestamp.Equal(&build.CreationTimestamp) {

Review Comment:
   This condition is included in the block that handles the cases where all 
dependencies are matching. 
   However, while testing, I saw the issue happening where at least half, but 
not all of the dependencies match. Each build kept waiting for the other one.
   This is the scenario in the test case 
`TestMatchingBuildsSchedulingSharedDependencies`.
   I handle it in the first `else` block.
   Before it would just return true, causing the deadlock:
   ```
                        } else if missing > 0 {
                                // found another suitable scheduled build with 
fewer dependencies that should build first in order to reuse the produced image
                                return true, &b
   ```
   I also included a runtime check. If the builds have different runtime 
versions, they can't share images and thus there's no reason to wait.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to