Skip to content

Span in Kotlin withTimeout has wrong parent #9890

@yonigibbs

Description

@yonigibbs

Tracer Version(s)

1.54.0

Java Version(s)

21.0.7

JVM Vendor

Other (please specify in comments)

Bug Report

Hi! I have the following code in a Kotlin Ktor server application, when handling an incoming HTTP request:

post("/foo") {
    span("withTimeoutOutside") {
        delay(100)
        withTimeout(500) {
            span("withTimeoutInside") {
                delay(100)
            }
        }
    }
}

I'd expect the root span (for the HTTP request) to have a child of withTimeoutOutside, which has a child of withTimeoutInside. Instead, what I see is this:

Image

This is possibly related to the fixes put in place for #7215.

Let me know if you need me to provide anything else to help with this.

Thanks in advance!

(Am running on OpenJDK 64-Bit Server VM Temurin-21.0.7+6)

Expected Behavior

I'd expect the root span (for the HTTP request) to have a child of withTimeoutOutside, which has a child of withTimeoutInside.

Reproduction Code

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugBug report and fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions