mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 22:53:43 +00:00
virtcontainers: don't try to talk with the proxy when it's not running
To avoid long timeouts, the runtime shouldn't try to talk with the proxy when it's not running. Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
62c393c119
commit
58d278560e
@ -1569,6 +1569,13 @@ func (k *kataAgent) sendReq(request interface{}) (interface{}, error) {
|
||||
span.SetTag("request", request)
|
||||
defer span.Finish()
|
||||
|
||||
if k.state.ProxyPid > 0 {
|
||||
// check that proxy is running before talk with it avoiding long timeouts
|
||||
if err := syscall.Kill(k.state.ProxyPid, syscall.Signal(0)); err != nil {
|
||||
return nil, fmt.Errorf("Proxy is not running: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := k.connect(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user