go-ethereum/core/rawdb
AusIV 069a7e1f8a
core/rawdb: stop freezer process as part of freezer.Close() (#21010)
* core/rawdb: Stop freezer process as part of freezer.Close()

When you call db.Close(), it was closing the leveldb database first,
then closing the freezer, but never stopping the freezer process.
This could cause the freezer to attempt to write to leveldb after
leveldb had been closed, leading to a crash with a non-zero exit code.

This change adds a quit channel to the freezer, and freezer.Close()
will not return until the freezer process has stopped.

Additionally, when you call freezerdb.Close(), it will close the
AncientStore before closing leveldb, to ensure that the freezer goroutine
will be stopped before leveldb is closed.

* core/rawdb: Fix formatting for golint

* core/rawdb: Use backoff flag to avoid repeating select

* core/rawdb: Include accidentally omitted backoff
2020-05-11 15:11:17 +03:00
..
accessors_chain_test.go core/rawdb: check hash before return data from ancient db (#20195) 2019-11-19 12:32:57 +02:00
accessors_chain.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00
accessors_indexes_test.go core: lookup txs by block number instead of block hash (#19431) 2019-04-25 17:24:55 +03:00
accessors_indexes.go core: concurrent database reinit from freezer dump 2019-05-27 15:48:30 +03:00
accessors_metadata.go cmd/geth, core/rawdb: seamless freezer consistency, friendly removedb 2019-05-16 17:01:56 +03:00
accessors_snapshot.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00
database.go core/rawdb: stop freezer process as part of freezer.Close() (#21010) 2020-05-11 15:11:17 +03:00
freezer_reinit.go core/rawdb: fix reinit regression caused by the hash check PR 2019-11-27 14:41:47 +02:00
freezer_table_test.go core/rawdb: fix freezer table test error check 2020-03-18 06:55:30 -05:00
freezer_table.go core/rawdb: fix data race between Retrieve and Close (#20919) 2020-04-14 18:13:47 +03:00
freezer.go core/rawdb: stop freezer process as part of freezer.Close() (#21010) 2020-05-11 15:11:17 +03:00
schema.go core: fix two snapshot iterator flaws, decollide snap storage prefix 2020-03-23 12:34:27 +02:00
table_test.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00
table.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00