mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Embed: In case KVStoreHash verification fails, close the backend.
In case of failed verification, the server used to keep opened backend (so the file was locked on OS level).
This commit is contained in:
@@ -229,6 +229,9 @@ func StartEtcd(inCfg *Config) (e *Etcd, err error) {
|
||||
if err = e.Server.CheckInitialHashKV(); err != nil {
|
||||
// set "EtcdServer" to nil, so that it does not block on "EtcdServer.Close()"
|
||||
// (nothing to close since rafthttp transports have not been started)
|
||||
|
||||
e.cfg.logger.Error("checkInitialHashKV failed", zap.Error(err))
|
||||
e.Server.Cleanup()
|
||||
e.Server = nil
|
||||
return e, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user