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
}
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:
key words:
some pictures 👇