Unverified Commit a13c952b authored by Hussein Galal's avatar Hussein Galal Committed by GitHub

[Release-1.20] fix Node stuck at deletion (#3776)

* fix Node stuck at deletion Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * fix Node stuck at deletion Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com>
parent 1769e7ed
...@@ -41,10 +41,11 @@ import ( ...@@ -41,10 +41,11 @@ import (
) )
const ( const (
endpoint = "https://127.0.0.1:2379" endpoint = "https://127.0.0.1:2379"
testTimeout = time.Second * 10 testTimeout = time.Second * 10
manageTickerTime = time.Second * 15 manageTickerTime = time.Second * 15
learnerMaxStallTime = time.Minute * 5 learnerMaxStallTime = time.Minute * 5
memberRemovalTimeout = time.Minute * 1
// defaultDialTimeout is intentionally short so that connections timeout within the testTimeout defined above // defaultDialTimeout is intentionally short so that connections timeout within the testTimeout defined above
defaultDialTimeout = 2 * time.Second defaultDialTimeout = 2 * time.Second
...@@ -560,6 +561,8 @@ func (e *ETCD) cluster(ctx context.Context, forceNew bool, options executor.Init ...@@ -560,6 +561,8 @@ func (e *ETCD) cluster(ctx context.Context, forceNew bool, options executor.Init
// removePeer removes a peer from the cluster. The peer ID and IP address must both match. // removePeer removes a peer from the cluster. The peer ID and IP address must both match.
func (e *ETCD) removePeer(ctx context.Context, id, address string, removeSelf bool) error { func (e *ETCD) removePeer(ctx context.Context, id, address string, removeSelf bool) error {
ctx, cancel := context.WithTimeout(ctx, memberRemovalTimeout)
defer cancel()
members, err := e.client.MemberList(ctx) members, err := e.client.MemberList(ctx)
if err != nil { if err != nil {
return err return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment