-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR fixes a bug that occurs when a cached operation has completed… (
#15) * This PR fixes a bug that occurs when a cached operation has completed and the timout period has expired. When this happens select in wait() can't be trusted to return correctly, as a negative duration will lead to time.After() firing immediately and the runtime can randomly chose either case. This leads to random timeout errors when a value is cached. * Moved wg.Add to avoid possible race condition. * Moved completed.IsSet() to wait to avoid potential race condition. * Moved comment Co-authored-by: ygonzalez <yoel.gonzalez@mailchimp.com>
- Loading branch information
Showing
2 changed files
with
48 additions
and
15 deletions.
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