Skip to content

cmd/go, x/telemetry: counter.Open breaks runtime deadlock detection #68497

Closed
@findleyr

Description

@findleyr

Reported by @cuonglm in #68311: it looks like counter.Open breaks runtime deadlock detection (the all goroutines are asleep...), probably due to the timer to rotate the counter file. This is just a guess -- I'm not sure how that deadlock detection works.
https://go.googlesource.com/telemetry/+/refs/heads/master/internal/counter/file.go#192

#68311 (comment)

CC @golang/telemetry

We should fix this for 1.23. The safest fix is probably to have a separate telemetry.Open call that does not rotate, since all cmd/go invocations should have a short lifespan and no rotation is necessary. @matloob what do you think?

@golang/runtime: is there a trick to set a timer that doesn't affect deadlock detection?

Activity

added this to the Go1.23 milestone on Jul 17, 2024
self-assigned this
on Jul 17, 2024
findleyr

findleyr commented on Jul 17, 2024

@findleyr
MemberAuthor

Reproduced and confirmed that avoiding the timer fixes the symptoms.

added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Jul 17, 2024
gopherbot

gopherbot commented on Jul 17, 2024

@gopherbot
Contributor

Change https://go.dev/cl/599075 mentions this issue: counter: avoid the rotation timer in counter.Open

added
NeedsFixThe path to resolution is known, but the work has not been done.
and removed
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Jul 17, 2024
findleyr

findleyr commented on Jul 17, 2024

@findleyr
MemberAuthor

Will close this after revendoring telemetry.

Upon further consideration, I don't think this meets the threshold of a release blocker, since it only affects already-broken programs. I still think we should land the above fix for 1.23, however.

gopherbot

gopherbot commented on Jul 17, 2024

@gopherbot
Contributor

Change https://go.dev/cl/598957 mentions this issue: cmd: vendor golang.org/x/telemetry@0b706e1

added a commit that references this issue on Jul 17, 2024
7321aa9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

Status

Done

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @gopherbot@cherrymui@findleyr

      Issue actions

        cmd/go, x/telemetry: counter.Open breaks runtime deadlock detection · Issue #68497 · golang/go