Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
bb9f9ccf
Unverified
Commit
bb9f9ccf
authored
3 years ago
by
Martin Holst Swende
Committed by
GitHub
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/rawdb: wait for background freezing to exit when closing freezer (#22878)
parent
67e7f61a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
database.go
core/rawdb/database.go
+5
-1
freezer.go
core/rawdb/freezer.go
+3
-0
No files found.
core/rawdb/database.go
View file @
bb9f9ccf
...
...
@@ -197,7 +197,11 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, freezer string, namespace st
}
// Freezer is consistent with the key-value database, permit combining the two
if
!
frdb
.
readonly
{
go
frdb
.
freeze
(
db
)
frdb
.
wg
.
Add
(
1
)
go
func
()
{
frdb
.
freeze
(
db
)
frdb
.
wg
.
Done
()
}()
}
return
&
freezerdb
{
KeyValueStore
:
db
,
...
...
This diff is collapsed.
Click to expand it.
core/rawdb/freezer.go
View file @
bb9f9ccf
...
...
@@ -84,6 +84,7 @@ type freezer struct {
trigger
chan
chan
struct
{}
// Manual blocking freeze trigger, test determinism
quit
chan
struct
{}
wg
sync
.
WaitGroup
closeOnce
sync
.
Once
}
...
...
@@ -145,6 +146,8 @@ func (f *freezer) Close() error {
var
errs
[]
error
f
.
closeOnce
.
Do
(
func
()
{
close
(
f
.
quit
)
// Wait for any background freezing to stop
f
.
wg
.
Wait
()
for
_
,
table
:=
range
f
.
tables
{
if
err
:=
table
.
Close
();
err
!=
nil
{
errs
=
append
(
errs
,
err
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment