Skip to content
/ etcd Public
forked from etcd-io/etcd

Commit

Permalink
Merge pull request etcd-io#6270 from heyitsanthony/etcdserver-timeout
Browse files Browse the repository at this point in the history
etcdserver: use request timeout defined by ServerConfig for v3 requests
  • Loading branch information
xiang90 authored Aug 26, 2016
2 parents 4f5cacc + 254c0ea commit 417b946
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions etcdserver/v3_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ const (
// specify a large value might end up with shooting in the foot.
maxRequestBytes = 1.5 * 1024 * 1024

// max timeout for waiting a v3 request to go through raft.
maxV3RequestTimeout = 5 * time.Second

// In the health case, there might be a small gap (10s of entries) between
// the applied index and committed index.
// However, if the committed entries are very heavy to apply, the gap might grow.
Expand Down Expand Up @@ -557,7 +554,7 @@ func (s *EtcdServer) processInternalRaftRequestOnce(ctx context.Context, r pb.In
}
ch := s.w.Register(id)

cctx, cancel := context.WithTimeout(ctx, maxV3RequestTimeout)
cctx, cancel := context.WithTimeout(ctx, s.Cfg.ReqTimeout())
defer cancel()

start := time.Now()
Expand Down

0 comments on commit 417b946

Please sign in to comment.