You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using geth as a library (version: 1.8.8) and instantiating a new node on a (private) Clique network.
The node sets-up the Genesis block in the DB just fine.
When trying to shut down the node however, the node locks when trying to close the DB
The problem is that it is indefinitely waiting for quitChan in ethdb/database.go#Close():
if db.quitChan != nil {
errc := make(chan error)
db.quitChan <- errc // <= This line
if err := <-errc; err != nil {
db.log.Error("Metrics collection failed", "err", err)
}
}
The reason is that nothing is ever sent to quitChan because the function func (db *LDBDatabase) meter(refresh time.Duration) returns before ever using the channel.
Since the DB is new, the following test makes it return too early because leveldb.iostats does not exist
ioStats, err := db.db.GetProperty("leveldb.iostats")
if err != nil {
db.log.Error("Failed to read database iostats", "err", err)
return
}
I believe, inside the if test, the statement db.quitChan = nil should be inserted to skip over the test in Close().
I guess the same reasoning applies to the test on leveldb.stats
(alternatively, why should missing levelddb.iostats cause the meter function to return, rather than the inner loop to continue?)
The text was updated successfully, but these errors were encountered:
Hi,
I am using geth as a library (version:
1.8.8
) and instantiating a new node on a (private) Clique network.The node sets-up the Genesis block in the DB just fine.
When trying to shut down the node however, the node locks when trying to close the DB
The problem is that it is indefinitely waiting for
quitChan
inethdb/database.go#Close()
:The reason is that nothing is ever sent to
quitChan
because the functionfunc (db *LDBDatabase) meter(refresh time.Duration)
returns before ever using the channel.Since the DB is new, the following test makes it return too early because
leveldb.iostats
does not existI believe, inside the
if
test, the statementdb.quitChan = nil
should be inserted to skip over the test inClose()
.I guess the same reasoning applies to the test on
leveldb.stats
(alternatively, why should missing
levelddb.iostats
cause themeter
function to return, rather than the inner loop tocontinue
?)The text was updated successfully, but these errors were encountered: