Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
singleflight: fix duplicate deleting key when Forget called
When Forget was called, we delete key associated with current call from map. When that call is done, it does delete key again, causing the same key set by other call after Forget lost. To fix it, adding a boolean value to check whether the call is forgotten, the call only does delete key if Forget is not called. Fixes golang/go#31420 Change-Id: I9708352ca3ff76c77f659916b37a496fdeb480d2 Reviewed-on: https://go-review.googlesource.com/c/sync/+/171897 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
- Loading branch information
Showing
2 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters