Skip to content

[Bug] Spring Cloud Gateway plugin causes traceIds duplicated with different requests #13443

Description

@happier2

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

Java Agent (apache/skywalking-java)

What happened

With Spring Cloud(version 2024.0.0) and Spring Cloud Gateway(version 4.2.0), Spring Cloud Gateway will dispatch requests to other services. What we expect is that every request that dispatched by gateway should have unique traceId in the downstream micro-services. But, we found theses traceIds are duplicated when the concurrency of requests is very high.

Image

We just log all these request's headers and bodies (micro-service just uses servlet container, which is tomcat). We can conclude that thread http-nio-48084-exec-9 and thread http-nio-48084-exec-5 have same traceId and same http header "sw8", while these two reuqests are different outer requests that have different request bodies.

What you expected to happen

I suspect that it is caused by this patch #747. This problem is only happened when concurrency is heavy.

How to reproduce

With Spring Cloud version 2024.0.0+, Spring Cloud Gateway(webflux) and one service with tomcat and concurrency is heavy.

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Activity

  1. added
    bugSomething isn't working and you are sure it's a bug!
    on Aug 29, 2025
  2. locked and limited conversation to collaborators on Aug 29, 2025
  3. converted this issue into a discussion #13444 on Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working and you are sure it's a bug!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions