Add timeout in load shim v2
add timeout in connect shim v2 avoid starting containerd hang Signed-off-by: Ace-Tang <aceapril@126.com>
This commit is contained in:
parent
434f69e790
commit
95f9bbf18b
@ -100,6 +100,8 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt
|
|||||||
events: events,
|
events: events,
|
||||||
rtTasks: rt,
|
rtTasks: rt,
|
||||||
}
|
}
|
||||||
|
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||||
|
defer cancel()
|
||||||
if err := s.Connect(ctx); err != nil {
|
if err := s.Connect(ctx); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user