A strange blocking problem when reconnecting an existing dB.
af913337456 opened this issue · comments
Ghost commented
When my program safely exits after running for some time, it calls“ db.stop ”Class. Then when you run the same program again, 100% of them will be blocked when connecting to the database. It will be blocked for a long time, and finally you have to delete the entire database directory to recover.
connected code below:
func NewDefaultRocksNormalDb(dataDir string) (*gorocksdb.DB, error) {
rateLimiter := defaultRateLimiter()
opts := gorocksdb.NewDefaultOptions()
opts.SetRateLimiter(rateLimiter)
opts.SetCreateIfMissing(true)
db, err := gorocksdb.OpenDb(opts, dataDir) // break point tells me, it will block here
if err != nil {
return nil, fmt.Errorf("NewDefaultRocksNormalDb failed: (%s)", err.Error())
}
return db, nil
}
key words:
- After a long run, stop the program;
- run again
some pictures 👇
Ghost commented
Ghost commented
Ghost commented