-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go, x/telemetry: counter.Open breaks runtime deadlock detection #68497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Reproduced and confirmed that avoiding the timer fixes the symptoms. |
Change https://go.dev/cl/599075 mentions this issue: |
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. |
As observed in golang/go#68497, scheduling a rotation timer can break runtime deadlock detection (all goroutines are asleep...). Furthermore, for short-lived processes such as command line tools, there is no reason to schedule a file rotation. Therefore, change the default behavior of counter.Open not to rotate the counter file, and introduce a new OpenAndRotate API to be used by gopls. For golang/go#68497 Change-Id: I7929c2d622d15e36ca99036d8c7eac1eed8fabf5 Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/599075 Auto-Submit: Robert Findley <[email protected]> Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Change https://go.dev/cl/598957 mentions this issue: |
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?
The text was updated successfully, but these errors were encountered: