]> Cypherpunks repositories - gostls13.git/commit
runtime: avoid panic in expired synctest timer chan read
authorDamien Neil <dneil@google.com>
Tue, 10 Dec 2024 17:49:45 +0000 (09:49 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 10 Dec 2024 19:51:25 +0000 (19:51 +0000)
commit4ce116a884bd55d7046dbc999f329fa417414c00
treecc1f863bdb4d8494dceb66549eba189f53b4ed63
parente6de1b2debe2bc7211f6f9cac4b64d7cd90f7c4e
runtime: avoid panic in expired synctest timer chan read

When reading from time.Timer.C for an expired timer using
a fake clock (in a synctest bubble), the timer will not
be in a heap. Avoid a spurious panic claiming the timer
moved between synctest bubbles.

Drop the panic when a bubbled goroutine reads from a
non-bubbled timer channel: We allow bubbled goroutines
to access non-bubbled channels in general.

Fixes #70741

Change-Id: I27005e46f4d0067cc6846d234d22766d2e05d163
Reviewed-on: https://go-review.googlesource.com/c/go/+/634955
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/internal/synctest/synctest_test.go
src/runtime/time.go