Browse Source

etcd-tester: retry for 'etcdserver: not capable'

Fix https://github.com/coreos/etcd/issues/5573.

Currently stresser starts at the same time as cluster start.
If the stresser got launched too fast/early, all stressers
exit from the error 'etcdserver: not capable', which
means the cluster is not ready yet. This adds additional
error checking, so stresser can retry.
Gyu-Ho Lee 9 years ago
parent
commit
350673f1f8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      tools/functional-tester/etcd-tester/stresser.go

+ 4 - 0
tools/functional-tester/etcd-tester/stresser.go

@@ -26,6 +26,7 @@ import (
 
 	clientV2 "github.com/coreos/etcd/client"
 	"github.com/coreos/etcd/etcdserver"
+	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"golang.org/x/net/context"
 	"google.golang.org/grpc"
@@ -112,6 +113,9 @@ func (s *stresser) Stress() error {
 					case transport.ErrConnClosing.Desc:
 						// server closed the transport (failure injected node)
 						shouldContinue = true
+					case rpctypes.ErrNotCapable.Error():
+						// capability check has not been done (in the beginning)
+						shouldContinue = true
 
 						// default:
 						// errors from stresser.Cancel method: