Revert "fix(sandbox/v2): oneshot containers never cleaned up by watcher"
This reverts commit c26d764857.
This commit is contained in:
parent
cc0bb7e161
commit
56fe84fa33
4 changed files with 0 additions and 15 deletions
|
|
@ -64,8 +64,6 @@ func BuildCreateOptions(cfg *types.SandboxConfig, identifier, ownerID, workspace
|
||||||
}
|
}
|
||||||
if opts.IdleTimeout == 0 {
|
if opts.IdleTimeout == 0 {
|
||||||
switch opts.Policy {
|
switch opts.Policy {
|
||||||
case infra.OneShot:
|
|
||||||
opts.IdleTimeout = infra.DefaultOneShotIdleTimeout
|
|
||||||
case infra.Session:
|
case infra.Session:
|
||||||
opts.IdleTimeout = infra.DefaultSessionIdleTimeout
|
opts.IdleTimeout = infra.DefaultSessionIdleTimeout
|
||||||
case infra.LongRunning:
|
case infra.LongRunning:
|
||||||
|
|
|
||||||
|
|
@ -478,8 +478,6 @@ func (m *Manager) recoverBoxes(ctx context.Context, nodeID string, res *tai.Conn
|
||||||
manager: m,
|
manager: m,
|
||||||
}
|
}
|
||||||
switch policy {
|
switch policy {
|
||||||
case OneShot:
|
|
||||||
box.idleTimeoutD = DefaultOneShotIdleTimeout
|
|
||||||
case Session:
|
case Session:
|
||||||
box.idleTimeoutD = DefaultSessionIdleTimeout
|
box.idleTimeoutD = DefaultSessionIdleTimeout
|
||||||
case LongRunning:
|
case LongRunning:
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ const (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DefaultStopTimeout = 2 * time.Second
|
DefaultStopTimeout = 2 * time.Second
|
||||||
DefaultOneShotIdleTimeout = 30 * time.Minute
|
|
||||||
DefaultSessionIdleTimeout = 30 * time.Minute
|
DefaultSessionIdleTimeout = 30 * time.Minute
|
||||||
DefaultLongRunningIdleTimeout = 2 * time.Hour
|
DefaultLongRunningIdleTimeout = 2 * time.Hour
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -86,16 +86,6 @@ func (w *sandboxWatcher) Check(ctx context.Context) []monitor.Alert {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch b.policy {
|
switch b.policy {
|
||||||
case OneShot:
|
|
||||||
alerts = append(alerts, monitor.Alert{
|
|
||||||
Level: monitor.Warn,
|
|
||||||
Target: "box:" + b.id,
|
|
||||||
Message: fmt.Sprintf("oneshot idle expired (idle=%s, timeout=%s), removing", idle.Round(time.Second), timeout),
|
|
||||||
Action: func(ctx context.Context) {
|
|
||||||
mgr.Remove(ctx, b.id)
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
case Session:
|
case Session:
|
||||||
alerts = append(alerts, monitor.Alert{
|
alerts = append(alerts, monitor.Alert{
|
||||||
Level: monitor.Warn,
|
Level: monitor.Warn,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue