Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
agent: check: Increase timeout check request.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jcvenegas authored and Eric Ernst committed Aug 23, 2018
1 parent 28b299f commit e4ccf03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virtcontainers/kata_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
)

var (
checkRequestTimeout = 30 * time.Second
defaultKataSocketName = "kata.sock"
defaultKataChannel = "agent.channel.0"
defaultKataDeviceID = "channel0"
Expand Down Expand Up @@ -1197,7 +1198,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...)
}
Expand Down

0 comments on commit e4ccf03

Please sign in to comment.