-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visitable.accept visits all Visitor instances regardless of the type #438
Comments
I am not sure that I completely understand what the problem is, so let me try to provide some details on how it should work (or at least how I remember it should work). The 1st pass we forward/ Why ? Because we want directly matching So, the highlighted double for loop seems needed to me. Also, accepting all types of |
OK; I might have misdiagnosed the issue then. However, we still have a problem here. Still digging into it. The test that revealed this (among others) was https://github.com/eclipse/jkube/blob/5da6068d7756784aef9569568ee80f98da97e296/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/TriggersAnnotationEnricherTest.java#L59 For some reason the visitor is being triggered multiple times. |
So the following test fabric8io/kubernetes-client#5558 illustrates the problem. In this case, the visitor is called 4 times instead of the expected 1 (or at least this is how it behaved before). The problem might be in the There seems to be some recursion going on. |
@manusa this should be unrelated to the recent change - all that did was move the existing logic. At least for me if I change Visitable and Basefluent back to what they were, you still see things visited multiple times. |
I'm not sure if you've checked fabric8io/kubernetes-client#5558 (maybe I should port it to this repo though) It illustrates the issue, it works with 6.9.0 but fails with 6.9.1. As you say, your changes just move around code. However, it's my impression that some of the changes regarding the use of the Map and its entries seem to be causing the visiting logic to become recursive. |
It's something else that has changed with 6.9.1 - if you revert BaseFluent / Visitable in 6.9.1, you see 4 visitations. If you forward port the changes in 6.9.0 you see 1 visitation. |
You mean just bumping the Sundrio version or something else? |
So I've tried Fabric8's main branch with Sundrio 0.101.0 and the test passes correctly. So it must be something changed in Sundrio between these two versions: |
I've found the issue. There's a place in the generated fluents where the visitable tracking is not correct. |
I'm trying to implement a test for this repo, hopefully will send a PR in a few minutes |
also ensuring copyInstance does not duplicate with calls closes sundrio#438
I finally managed to create the reproducer test, nothing like a good weekend's rest :) |
also ensuring copyInstance does not duplicate with calls closes #438
sundrio/sundrio#438 Signed-off-by: Marc Nuri <marc@marcnuri.com>
sundrio/sundrio#438 Signed-off-by: Marc Nuri <marc@marcnuri.com>
sundrio/sundrio#438 Signed-off-by: Marc Nuri <marc@marcnuri.com>
sundrio/sundrio#438 Signed-off-by: Marc Nuri <marc@marcnuri.com>
sundrio/sundrio#438 Signed-off-by: Marc Nuri <marc@marcnuri.com>
Changes in #431 seem to be causing an issue with Visitors
With the new changes in:
sundrio/core/src/main/java/io/sundr/builder/Visitable.java
Lines 77 to 91 in 836ebea
Visitors are now called regardless of the matching type.
Seems like the double for-loop is a mistake or something left from previous iterations.
/cc @shawkins @iocanel
The text was updated successfully, but these errors were encountered: