Skip to content

Autostop: fall back to workspace.ttl if workspace.latest_build.deadline is zero #1942

Closed
@johnstcn

Description

@johnstcn

Definition of Done

Workspace autostop should fallback to the workspace.ttl if the workspace.latest_build.deadline is zero.

Steps to Reproduce

  • Create a workspace with autostop enabled
  • Start workspace and wait for transition to complete
  • Edit database and set workspace.latest_build.deadline to time.Zero e.g.
      update workspace_builds set deadline='0001-01-01 00:00:00+00' where id = 'deadbeef-dead-beef-dead-beefdeadbeef';
    
  • Observe that workspace does not auto-stop

Expected

Workspace should auto-stop after now plus workspace TTL.

Actual

Workspace does not auto-stop.

Logs

Jun 01 13:39:57 coder coder[28025]: 2022-06-01 13:39:57.575 [DEBUG]        <./coderd/autobuild/executor/lifecycle_executor.go:132>        (*Executor).runOnce.func2        latest workspace build has zero deadline, skipping        {"workspace_
id": "64ff14cb-3b2d-4aad-8011-247f2cf9332f", "workspace_build_id": "a67e7139-6266-4e03-8d91-eb21ed14642d"}

Notes

Metadata

Metadata

Assignees

Labels

apiArea: HTTP API

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions