Skip to content

Reconciliation for one Reconciler is sometimes executed in parallel in two different threads #2326

Closed
@ebma16

Description

@ebma16

Hello,

I'm currently implementing some simple Integration Tests, using Kotlin and
jenvtest v0.9.7,
josdk v4.8.1

Even if I noticed following topics during the implementation of Integration Tests, I think it is more related to the Event Sources..
Unfortunately my project is no open source, so I will try to describe what I'm doing and provide some log messages.

  • My operator consists of 3 different reconcilers.
  • Every reconciler manages one CRD and listens to events of Custom Resources managed by the other Reconcilers via EventSources.
  • Additionally two reconcilers manage its own dependent resources (via a Managed Dependent Resources Workflow).

Before any Integration Test is executed, I want to start the operator and register every reconciler via:

    val operator = Operator { overrider: ConfigurationServiceOverrider -> overrider.withKubernetesClient(client) }
    operator.register(Reconciler1())
    operator.register(Reconciler2())
    operator.register(Reconciler3())

My observations:

  • What I sometimes notice is, that a reconciliation of the same reconciler is executed in parallel when starting the operator (see "Example 1" in attached file "eventSourcesExample").
  • I can see this behaviour also for Dependent Resources. Sometimes the reconciliation for a Dependent Resource is executed in parallel, afterwards it will be tried to create the Dependent Resource in parallel, and fabric8 throws an Exception, that the Dependent Resource is already existing (see "Example 2" in attached file "eventSourcesExample").

I've also attached the more detailed debug log (see attached file "DebugOutput").

My questions:

  • Is this something expected and has to be prevented by myself?
  • Is it possible that the reconciliation for a reconciler is executed in parallel in case it is triggered by a change of the own Custom Resource and by an Event from another Custom Resource?

Files:
eventSourcesExample.txt
DebugOutput.txt

@csviri I invited you to a repository, that has a similar structure like the production one and where you could reproduce the issue when executing the "OperatorIntegrationTest". Sometimes this behaviour happens more often, sometimes only once in 10 runs...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions