Skip to content

KubernetesDependentResource implementing Matcher causes StackOverflowError #1783

@xintellion

Description

@xintellion

If sub classes of KubernetesDependentResource implement Matcher the matcher field of the class is set to this in the constructor

https://github.com/java-operator-sdk/java-operator-sdk/blob/f1b02f7e8a62242399aed7e8e2b10e948f67e341/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java#L51

This produces an infinit recursion when the match method is called which throws an StackOverflowError error.
https://github.com/java-operator-sdk/java-operator-sdk/blob/f1b02f7e8a62242399aed7e8e2b10e948f67e341/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java#L143

I have a standalone reconciler with a manuall worflow configure using operator-framework-spring-boot-starter (4.1.1).

Since the execution of the reconciler is in a separate thread the application keeps running but somehow the Error got totaly swallowed by the try catch block of the NodeExecuter run method. So there is space for improvement in the error handling.

The only workaround is to not let KubernetesDependentResource implement Matcher but override the method which is public anyway in the sub-class.

Metadata

Metadata

Assignees

Labels

lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions