mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-01 17:52:40 +00:00
agent: check: Increase timeout check request.
In some slow enviroments the agent is taking more than 5 seconds to start to serve grpc request. This was reproducible in a Centos VM with 4 cpus running 8 pods in parallel. Fixes: #516 Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
12e1911aab
commit
5fc7219315
@ -34,6 +34,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
checkRequestTimeout = 30 * time.Second
|
||||
defaultKataSocketName = "kata.sock"
|
||||
defaultKataChannel = "agent.channel.0"
|
||||
defaultKataDeviceID = "channel0"
|
||||
@ -1278,7 +1279,7 @@ type reqFunc func(context.Context, interface{}, ...golangGrpc.CallOption) (inter
|
||||
func (k *kataAgent) installReqFunc(c *kataclient.AgentClient) {
|
||||
k.reqHandlers = make(map[string]reqFunc)
|
||||
k.reqHandlers["grpc.CheckRequest"] = func(ctx context.Context, req interface{}, opts ...golangGrpc.CallOption) (interface{}, error) {
|
||||
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
ctx, cancel := context.WithTimeout(ctx, checkRequestTimeout)
|
||||
defer cancel()
|
||||
return k.client.Check(ctx, req.(*grpc.CheckRequest), opts...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user