mirror of
https://github.com/rancher/steve.git
synced 2025-09-11 12:19:53 +00:00
Fix race condition with database reset (#804)
* Wait for garbage collection to be finished before creating a new DB * Prevent DB reset while inflight List requests * Rename cacheFor to cacheForLocked * Rename Reset to Stop * Mention DoneWithCache in README * Add RunGC to ByOptionsLister interface
This commit is contained in:
@@ -95,7 +95,10 @@ func (i *IntegrationSuite) TestSQLCacheFilters() {
|
||||
|
||||
cache, cacheFactory, err := i.createCacheAndFactory(fields, nil)
|
||||
require.NoError(err)
|
||||
defer cacheFactory.Reset()
|
||||
defer func() {
|
||||
cacheFactory.DoneWithCache(cache)
|
||||
cacheFactory.Stop()
|
||||
}()
|
||||
|
||||
// doesn't match the filter for somekey == somevalue
|
||||
notMatches := configMapWithAnnotations("not-matches-filter", map[string]string{"somekey": "notequal"})
|
||||
@@ -327,7 +330,7 @@ func (i *IntegrationSuite) createCacheAndFactory(fields [][]string, transformFun
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("unable to make cache: %w", err)
|
||||
}
|
||||
return &cache, cacheFactory, nil
|
||||
return cache, cacheFactory, nil
|
||||
}
|
||||
|
||||
func (i *IntegrationSuite) waitForCacheReady(readyResourceNames []string, namespace string, cache *factory.Cache) error {
|
||||
|
Reference in New Issue
Block a user