Skip to content

Logging MDC values get confused with overlapping reconciler calls #1203

@nstuart

Description

@nstuart

Expected Behavior

Logging MDC values like resource.name and resource.namespace are correct for reconciled resources in question

Actual Behavior

When multiple reconciliations are happening at once, the MDC values seem to be "random" and could be set to any values for any of the reconciliations.

Notes

When enabling JSON logging and looking at the MDC values provided out of the box by the framework I noticed that the values were pretty jumbled when a lot of reconciliations were happening in parallel. I assume this is because the underlying Java Operator SDK is responsible for the values, as documented here, and it doesn't play well with the Quarkus threading approach.

If I add my own interceptor and clear the MDC and re-add those values, things appear to stick as expected, from my limited testing

I don't see a way to disable the JOSDK values, or that the Quarkus Operator will inject it's own (with the appropriate threading model for the MDC).

Metadata

Metadata

Assignees

No one assigned

    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