07f2854683
* Fix race condition during a cache get Check the entry we pulled out of the cache while holding the lock had Fetching set. If it did then we should use the existing Waiter instead of calling fetch. The reason this is better than just calling fetch is that fetch re-gets the entry out of the entries map and the previous fetch may have finished. Therefore this prevents erroneously starting a new fetch because we just missed the last update. * Fix race condition fully The first commit still allowed for the following scenario: • No entry existing when checked in getWithIndex while holding the read lock • Then by time we had reached fetch it had been created and finished. * always use ok when returning * comment mentioning the reading from entries. * use cacheHit consistently |
||
---|---|---|
.. | ||
cache.go | ||
cache_test.go | ||
entry.go | ||
entry_test.go | ||
mock_Request.go | ||
mock_Type.go | ||
request.go | ||
testing.go | ||
type.go | ||
watch.go | ||
watch_test.go |