mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #6270 from heyitsanthony/etcdserver-timeout
etcdserver: use request timeout defined by ServerConfig for v3 requests
This commit is contained in:
commit
417b9469aa
@ -35,9 +35,6 @@ const (
|
|||||||
// specify a large value might end up with shooting in the foot.
|
// specify a large value might end up with shooting in the foot.
|
||||||
maxRequestBytes = 1.5 * 1024 * 1024
|
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
|
// In the health case, there might be a small gap (10s of entries) between
|
||||||
// the applied index and committed index.
|
// the applied index and committed index.
|
||||||
// However, if the committed entries are very heavy to apply, the gap might grow.
|
// However, if the committed entries are very heavy to apply, the gap might grow.
|
||||||
@ -557,7 +554,7 @@ func (s *EtcdServer) processInternalRaftRequestOnce(ctx context.Context, r pb.In
|
|||||||
}
|
}
|
||||||
ch := s.w.Register(id)
|
ch := s.w.Register(id)
|
||||||
|
|
||||||
cctx, cancel := context.WithTimeout(ctx, maxV3RequestTimeout)
|
cctx, cancel := context.WithTimeout(ctx, s.Cfg.ReqTimeout())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user