mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-06 19:07:50 +00:00
Merge pull request #1413 from kuba--/stop-server
Do not stop etcd server before closing
This commit is contained in:
commit
d491c26b8e
2 changed files with 3 additions and 5 deletions
5
api.go
5
api.go
|
|
@ -117,6 +117,7 @@ var validAPIMethods = map[disco.ClusterState]map[apiMethod]struct{}{
|
|||
disco.ClusterStateNormal: appendMap(methodsCommon, methodsNormal),
|
||||
disco.ClusterStateDegraded: appendMap(methodsCommon, methodsDegraded),
|
||||
disco.ClusterStateResizing: appendMap(methodsCommon, methodsResizing),
|
||||
disco.ClusterStateDown: methodsCommon,
|
||||
}
|
||||
|
||||
func appendMap(a, b map[apiMethod]struct{}) map[apiMethod]struct{} {
|
||||
|
|
@ -2226,6 +2227,7 @@ const (
|
|||
|
||||
var methodsCommon = map[apiMethod]struct{}{
|
||||
apiClusterMessage: {},
|
||||
apiState: {},
|
||||
}
|
||||
|
||||
var methodsResizing = map[apiMethod]struct{}{
|
||||
|
|
@ -2233,7 +2235,6 @@ var methodsResizing = map[apiMethod]struct{}{
|
|||
apiTranslateData: {},
|
||||
apiResizeAbort: {},
|
||||
apiSchema: {},
|
||||
apiState: {},
|
||||
}
|
||||
|
||||
var methodsDegraded = map[apiMethod]struct{}{
|
||||
|
|
@ -2249,7 +2250,6 @@ var methodsDegraded = map[apiMethod]struct{}{
|
|||
apiRemoveNode: {},
|
||||
apiShardNodes: {},
|
||||
apiSchema: {},
|
||||
apiState: {},
|
||||
apiViews: {},
|
||||
apiStartTransaction: {},
|
||||
apiFinishTransaction: {},
|
||||
|
|
@ -2279,7 +2279,6 @@ var methodsNormal = map[apiMethod]struct{}{
|
|||
apiRemoveNode: {},
|
||||
apiShardNodes: {},
|
||||
apiSchema: {},
|
||||
apiState: {},
|
||||
apiViews: {},
|
||||
apiApplySchema: {},
|
||||
apiStartTransaction: {},
|
||||
|
|
|
|||
|
|
@ -107,7 +107,6 @@ func (e *Etcd) Close() error {
|
|||
if e.heartbeatCancel != nil {
|
||||
e.heartbeatCancel()
|
||||
}
|
||||
e.e.Server.Stop()
|
||||
e.e.Close()
|
||||
<-e.e.Server.StopNotify()
|
||||
}
|
||||
|
|
@ -823,7 +822,7 @@ func (e *Etcd) leaseKeepAlive(ttl int64) (clientv3.LeaseID, func(context.Context
|
|||
if cli, err := e.client(); err != nil {
|
||||
log.Printf("leaseKeepAlive: creates a new client: %v\n", err)
|
||||
} else {
|
||||
if _, err := cli.Revoke(context.TODO(), leaseResp.ID); err != nil {
|
||||
if _, err := cli.Revoke(context.Background(), leaseResp.ID); err != nil {
|
||||
log.Printf("leaseKeepAlive: revokes the lease (ID: %x): %v\n", leaseResp.ID, err)
|
||||
}
|
||||
cli.Close()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue