]> Cypherpunks repositories - gostls13.git/commit
internal/singleflight: fix duplicate deleting key when ForgetUnshared called
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 23 Sep 2022 04:02:41 +0000 (11:02 +0700)
committerGopher Robot <gobot@golang.org>
Fri, 30 Sep 2022 20:05:46 +0000 (20:05 +0000)
commit826efd7f25f789ab06f257eee19f02b1dc6c8a09
treeea2855777a52ced4fd09145e617a836594021bbc
parent8a0cf719a626ebd1ec11531ebaeacccbd19178ec
internal/singleflight: fix duplicate deleting key when ForgetUnshared called

A key may be forgotten while the call is still in flight. So when the
call finished, it should only delete the key if that key is associated
with the call. Otherwise, we may remove the wrong newly created call.

Fixes #55343

Change-Id: I4fa72d79cad006e5884e42d885d193641ef84e0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/433315
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/internal/singleflight/singleflight.go
src/internal/singleflight/singleflight_test.go