Allow timeouts to be configured in config
This adds a singleton `timeout` package that will allow services and user to configure timeouts in the daemon. When a service wants to use a timeout, it should declare a const and register it's default value inside an `init()` function for that package. When the default config is generated, we can use the `timeout` package to provide the available timeout keys so that a user knows that they can configure. These show up in the config as follows: ```toml [timeouts] "io.containerd.timeout.shim.cleanup" = 5 "io.containerd.timeout.shim.load" = 5 "io.containerd.timeout.shim.shutdown" = 3 "io.containerd.timeout.task.state" = 2 ``` Timeouts in the config are specified in seconds. Timeouts are very hard to get right and giving this power to the user to configure things is a huge improvement. Machines can be faster and slower and depending on the CPU or load of the machine, a timeout may need to be adjusted. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -55,6 +55,8 @@ type Config struct {
|
||||
Cgroup CgroupConfig `toml:"cgroup"`
|
||||
// ProxyPlugins configures plugins which are communicated to over GRPC
|
||||
ProxyPlugins map[string]ProxyPlugin `toml:"proxy_plugins"`
|
||||
// Timeouts specified as a duration
|
||||
Timeouts map[string]string `toml:"timeouts"`
|
||||
|
||||
StreamProcessors []StreamProcessor `toml:"stream_processors"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user