mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "core/state, tests: fix memory leak via fastcache (#28387)"
This reverts commit 470d1cb31d.
This commit is contained in:
parent
5ba808cd6f
commit
7ae5506e8c
6 changed files with 1 additions and 26 deletions
|
|
@ -54,4 +54,4 @@ for:
|
||||||
- go run build/ci.go archive -arch %GETH_ARCH% -type zip -signer WINDOWS_SIGNING_KEY -upload gethstore/builds
|
- go run build/ci.go archive -arch %GETH_ARCH% -type zip -signer WINDOWS_SIGNING_KEY -upload gethstore/builds
|
||||||
- go run build/ci.go nsis -arch %GETH_ARCH% -signer WINDOWS_SIGNING_KEY -upload gethstore/builds
|
- go run build/ci.go nsis -arch %GETH_ARCH% -signer WINDOWS_SIGNING_KEY -upload gethstore/builds
|
||||||
test_script:
|
test_script:
|
||||||
- go run build/ci.go test -dlgo -arch %GETH_ARCH% -cc %GETH_CC% -short
|
- go run build/ci.go test -dlgo -arch %GETH_ARCH% -cc %GETH_CC%
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,6 @@ func doTest(cmdline []string) {
|
||||||
coverage = flag.Bool("coverage", false, "Whether to record code coverage")
|
coverage = flag.Bool("coverage", false, "Whether to record code coverage")
|
||||||
verbose = flag.Bool("v", false, "Whether to log verbosely")
|
verbose = flag.Bool("v", false, "Whether to log verbosely")
|
||||||
race = flag.Bool("race", false, "Execute the race detector")
|
race = flag.Bool("race", false, "Execute the race detector")
|
||||||
short = flag.Bool("short", false, "Pass the 'short'-flag to go test")
|
|
||||||
cachedir = flag.String("cachedir", "./build/cache", "directory for caching downloads")
|
cachedir = flag.String("cachedir", "./build/cache", "directory for caching downloads")
|
||||||
)
|
)
|
||||||
flag.CommandLine.Parse(cmdline)
|
flag.CommandLine.Parse(cmdline)
|
||||||
|
|
@ -319,9 +318,6 @@ func doTest(cmdline []string) {
|
||||||
if *race {
|
if *race {
|
||||||
gotest.Args = append(gotest.Args, "-race")
|
gotest.Args = append(gotest.Args, "-race")
|
||||||
}
|
}
|
||||||
if *short {
|
|
||||||
gotest.Args = append(gotest.Args, "-short")
|
|
||||||
}
|
|
||||||
|
|
||||||
packages := []string{"./..."}
|
packages := []string{"./..."}
|
||||||
if len(flag.CommandLine.Args()) > 0 {
|
if len(flag.CommandLine.Args()) > 0 {
|
||||||
|
|
|
||||||
|
|
@ -989,7 +989,6 @@ func (bc *BlockChain) Stop() {
|
||||||
if snapBase, err = bc.snaps.Journal(bc.CurrentBlock().Root); err != nil {
|
if snapBase, err = bc.snaps.Journal(bc.CurrentBlock().Root); err != nil {
|
||||||
log.Error("Failed to journal state snapshot", "err", err)
|
log.Error("Failed to journal state snapshot", "err", err)
|
||||||
}
|
}
|
||||||
bc.snaps.Release()
|
|
||||||
}
|
}
|
||||||
if bc.triedb.Scheme() == rawdb.PathScheme {
|
if bc.triedb.Scheme() == rawdb.PathScheme {
|
||||||
// Ensure that the in-memory trie nodes are journaled to disk properly.
|
// Ensure that the in-memory trie nodes are journaled to disk properly.
|
||||||
|
|
|
||||||
|
|
@ -45,16 +45,6 @@ type diskLayer struct {
|
||||||
lock sync.RWMutex
|
lock sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release releases underlying resources; specifically the fastcache requires
|
|
||||||
// Reset() in order to not leak memory.
|
|
||||||
// OBS: It does not invoke Close on the diskdb
|
|
||||||
func (dl *diskLayer) Release() error {
|
|
||||||
if dl.cache != nil {
|
|
||||||
dl.cache.Reset()
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Root returns root hash for which this snapshot was made.
|
// Root returns root hash for which this snapshot was made.
|
||||||
func (dl *diskLayer) Root() common.Hash {
|
func (dl *diskLayer) Root() common.Hash {
|
||||||
return dl.root
|
return dl.root
|
||||||
|
|
|
||||||
|
|
@ -656,13 +656,6 @@ func diffToDisk(bottom *diffLayer) *diskLayer {
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release releases resources
|
|
||||||
func (t *Tree) Release() {
|
|
||||||
if dl := t.disklayer(); dl != nil {
|
|
||||||
dl.Release()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Journal commits an entire diff hierarchy to disk into a single journal entry.
|
// Journal commits an entire diff hierarchy to disk into a single journal entry.
|
||||||
// This is meant to be used during shutdown to persist the snapshot without
|
// This is meant to be used during shutdown to persist the snapshot without
|
||||||
// flattening everything down (bad for reorgs).
|
// flattening everything down (bad for reorgs).
|
||||||
|
|
|
||||||
|
|
@ -200,9 +200,6 @@ func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config, snapshotter bo
|
||||||
if triedb != nil {
|
if triedb != nil {
|
||||||
triedb.Close()
|
triedb.Close()
|
||||||
}
|
}
|
||||||
if snaps != nil {
|
|
||||||
snaps.Release()
|
|
||||||
}
|
|
||||||
}()
|
}()
|
||||||
checkedErr := t.checkError(subtest, err)
|
checkedErr := t.checkError(subtest, err)
|
||||||
if checkedErr != nil {
|
if checkedErr != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue