Skip to content

MDC is leaking out to other threads #3106

Closed
@tom59

Description

@tom59

The MDC is leaking out of the context to other threads.

I am using micronaut 1.3.4 with MdcInstrumenter.
The MDC set in one thread leaks in another thread.
See the failing test there: https://github.com/tom59/micronaut-mdc-issue/blob/master/src/test/java/mn/mdc/instrumenter/MDCTest.java

Expected Behaviour

The MDC should not leak into other requests.

Actual Behaviour

The MDC sets for one request ends up in another request.
It is going there: https://github.com/tom59/micronaut-mdc-issue/blob/master/src/main/java/mn/mdc/instrumenter/RequestIdFilter.java#L25

Environment Information

  • Operating System: Mac
  • Micronaut Version: 1.3.4
  • JDK Version: 11

Example Application

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions