Closed lsergio closed 1 month ago
Adding the trait:
builder:
incrementalImageBuild: false
to each Integration or to the IntegrationPlatform didn't change the results.
The same scenario with Camel K 2.3.3 worked as expected. The builds ran sequentially.
Trying to understand the code, I guess this is related to how this method is implemented.
BuilderDependencies() will load the dependencies from the builder task in each build. Taking one of my builds as an example, I see the list:
dependencies:
- camel:quartz
- mvn:org.apache.camel.k:camel-k-cron
- mvn:org.apache.camel.k:camel-k-runtime
- mvn:org.apache.camel.quarkus:camel-quarkus-yaml-dsl
These strings do not take into account the jar version. If two builds use the same Camel components, but with different camel-k-runtimes, HasMachingBuild will work as if the dependencies were the same, but they are not.
This difference between 2.3.x and 2.4.0 is due to https://github.com/apache/camel-k/pull/5669. Indeed, changing the build order strategy to sequential in 2.4.0 fixes the issue and replicates the 2.3.x behavior.
Thanks for reporting. Yes, apparently the dependencies strategy is having some problem. We need to fix it, but in the while, the solution is to revert the build order strategy.
BTW, feel free to work on its resolution if you have the availability to.
After more troubleshooting, I figured out that the problem happens if 2 builds have exactly the same dependencies and have been created within the same second. This condition was supposed to give priority to whatever build was created first, but as the creationTimestamp precision is down to the second only, we may have equal timestamps and no build will be prioritized.
I think that in this case we might prioritize based on anothet criteria, like the build name, which is unique.
@squakez I'll try to come up with a solution and submit a PR. It this gets more complicated than I antecipated I'll let you know so we can unsassign the issue.
Excellent, thanks. Sure, just let me know how it goes.
The scenario was a bit trickier. I opened a draft PR for review, but I still need to build the operator and test it on a K8s cluster. I'll do it in the next few days.
What happened?
After creating 4 integrations at the same time, 3 of the builds are hanging for minutes after the first build has finished.
Steps to reproduce
This will create 4 Builds:
Checking the operator log I see:
It seems like each build is waiting for another one to finish;
Relevant log output
No response
Camel K version
2.4.0