HomeSource World

core/rawdb: stop freezer process as part of freezer.Close() (#21010)

Authored by AusIV <git@ausiv.com> on Mon, May 11, 12:11 PM.

Description

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

Details

Committed
GitHub <noreply@github.com>Mon, May 11, 12:11 PM
Parents
rGETHbd60295de56b: console: fix some crashes/errors in the bridge (#21050)
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGETH069a7e1f8abe: core/rawdb: stop freezer process as part of freezer.Close() (#21010) (authored by AusIV <git@ausiv.com>).Mon, May 11, 12:11 PM