Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #1317
johnstcn opened this issue Jun 1, 2022 · 3 comments
Closed
Tracked by #1317
Assignees
Labels
api Area: HTTP API
Milestone

Comments

@johnstcn
Copy link
Member

johnstcn commented Jun 1, 2022

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

@johnstcn johnstcn added bug 🐛 api Area: HTTP API labels Jun 1, 2022
@johnstcn johnstcn self-assigned this Jun 1, 2022
@ketang
Copy link
Contributor

ketang commented Jun 1, 2022

Maybe I don't understand the internals, but I'm not seeing how this is a bug.

@johnstcn
Copy link
Member Author

johnstcn commented Jun 1, 2022

Maybe I don't understand the internals, but I'm not seeing how this is a bug.

I filed the issue under the assumption that if it's unexpected behaviour, it's a bug.

@misskniss misskniss added this to the Community MVP milestone Jun 3, 2022
@kylecarbs kylecarbs changed the title bug: autostop: fall back to workspace.ttl if workspace.latest_build.deadline is zero Autostop: fall back to workspace.ttl if workspace.latest_build.deadline is zero Jun 7, 2022
@misskniss misskniss mentioned this issue Jul 19, 2022
20 tasks
@johnstcn
Copy link
Member Author

This leads to confusing behaviour. If you create a workspace with autostop not enabled, and then enable autostop, this will equate to the behaviour we originally wanted to avoid in #2229. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants