[KOGITO-1771] Checking build status before triggering a new build #323
Conversation
Signed-off-by: Ricardo Zanini <zanini@redhat.com>
List of tests being done:
|
Guys, this is a workaround to fix this bug, I'll address some of your comments, but like described everything will be rewritten soon: https://issues.redhat.com/browse/KOGITO-1999 |
Ok, will count with that. |
Agreed. I was not talking about your tests, that make a lot of sense to me. :) |
@MarianMacik can you take another look? I'll review the bug again based on your last comments on the JIRA: |
@ricardozanini I looked at the updates, looks good, just found that the if can be indeed even nicer :) Other than that looks good to me so far 😉 |
@sutaakar by seeing in your tests, it looks like you haven't faced the same issues as @MarianMacik . Are you guys using the same env? Looks like the problem does not happen on CRC. |
Yes, we should be using same environment (OCP 4.4, 3 master nodes) |
@MarianMacik by looking at your logs, maybe your operator version wasn't updated. |
The operator was built straight from this PR. I will try to update images version as well as I use 0.9.0. @ricardozanini BTW bear in mind it only happens to me on clusters with 3 master nodes. So on CRC it won't happen at all. I tried 4.3 and 4.4 with one and 3 master nodes and it only did for me on 3 master nodes.
My logs contain log messages added in this PR so I must have used the right version. |
I was just wondering why @sutaakar hasn’t seen it yet. I’ll take a look after my coffee. |
@ricardozanini Yes, good question. Maybe I run more tests with examples? I run Quarkus native/non-native + Spring Boot, all of that with and without persistence times 4 as I test 40k, 80k, 160k and 320k. And with 40k and 80k the issue doesn't manifest as the test finishes before the second build is finished. But with 160k and 320k the build finishes in the middle of the test and a pod is restarted and thus failing my test run. So I think that's why. |
It's a race condition problem.
Our code is not catching this build because it's created after ours probably. In the logs, I can see that we are only triggering once. Let's try to reconcile after the BC is created, then we will have time to catch all objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and issue is not reproducible anymore. Thanks for the fix & discussion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
minor comment
return t.buildConfig != nil | ||
} | ||
|
||
func (t *trigger) OnBuildConfig(buildConfig *buildv1.BuildConfig) Trigger { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that one used ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, but I've decided to let it there since we will use in the KogitoBuild CR. Just to not forget this interface.
Signed-off-by: Ricardo Zanini zanini@redhat.com
See:
https://issues.redhat.com/browse/KOGITO-1771
Small refactoring introducing the
build
package. It's basically the same thing, but we will follow this up on KOGITO-1999.I think this solved the issue, at least on my side, never happened again.
Many thanks for submiting your Pull Request ❤️!
Please make sure that your PR meets the following requirements:
[KOGITO-XYZ] Subject