diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2018-02-13 21:12:55 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-02-13 21:12:55 +0800 |
commit | b007412db165e22640eb4cef6cb41013f54ddd32 (patch) | |
tree | 3b490d579223f67e4c8f77b6b1ab75333905150b | |
parent | da41a7258d94fb35113f3b2da3635c7c451e5831 (diff) | |
download | dexon-b007412db165e22640eb4cef6cb41013f54ddd32.tar dexon-b007412db165e22640eb4cef6cb41013f54ddd32.tar.gz dexon-b007412db165e22640eb4cef6cb41013f54ddd32.tar.bz2 dexon-b007412db165e22640eb4cef6cb41013f54ddd32.tar.lz dexon-b007412db165e22640eb4cef6cb41013f54ddd32.tar.xz dexon-b007412db165e22640eb4cef6cb41013f54ddd32.tar.zst dexon-b007412db165e22640eb4cef6cb41013f54ddd32.zip |
core: soften up state memory force-commit log messages (#16080)
Talk about "state" instead of "trie timing", "trie memory" and remove
the overzealous warning when the limit is just reached. Since the time
limit is always reached on slow machines, move the message to info level
so users don't freak out about internal details.
-rw-r--r-- | core/blockchain.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index e498dedef..4ae0e4f4e 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -926,13 +926,9 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types. if chosen < lastWrite+triesInMemory { switch { case size >= 2*limit: - log.Error("Trie memory critical, forcing to disk", "size", size, "limit", limit, "optimum", float64(chosen-lastWrite)/triesInMemory) + log.Warn("State memory usage too high, committing", "size", size, "limit", limit, "optimum", float64(chosen-lastWrite)/triesInMemory) case bc.gcproc >= 2*bc.cacheConfig.TrieTimeLimit: - log.Error("Trie timing critical, forcing to disk", "time", bc.gcproc, "allowance", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory) - case size > limit: - log.Warn("Trie memory at dangerous levels", "size", size, "limit", limit, "optimum", float64(chosen-lastWrite)/triesInMemory) - case bc.gcproc > bc.cacheConfig.TrieTimeLimit: - log.Warn("Trie timing at dangerous levels", "time", bc.gcproc, "limit", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory) + log.Info("State in memory for too long, committing", "time", bc.gcproc, "allowance", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory) } } // If optimum or critical limits reached, write to disk |