mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-13 21:09:31 +00:00
Merge pull request #1094 from liubin/fix/991
runtime: sleep 1 second after GetOOMEvent failed
This commit is contained in:
@@ -20,6 +20,8 @@ import (
|
|||||||
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/oci"
|
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/oci"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const defaultCheckInterval = 1 * time.Second
|
||||||
|
|
||||||
func wait(s *service, c *container, execID string) (int32, error) {
|
func wait(s *service, c *container, execID string) (int32, error) {
|
||||||
var execs *exec
|
var execs *exec
|
||||||
var err error
|
var err error
|
||||||
@@ -152,6 +154,7 @@ func watchOOMEvents(ctx context.Context, s *service) {
|
|||||||
if isGRPCErrorCode(codes.NotFound, err) || err.Error() == "Dead agent" {
|
if isGRPCErrorCode(codes.NotFound, err) || err.Error() == "Dead agent" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
time.Sleep(defaultCheckInterval)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user