-
Notifications
You must be signed in to change notification settings - Fork 875
Disabling autostop causes workspace to get stuck with last autostop value #15390
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
Comments
Also, not sure if this is a bug but it feels a little unexpected to me, if you set the default to zero then no workspaces will autostop (expected), then later set the default to 24 all workspaces will autostop after 24 hours (expected), then later again enable customizing autostop, some workspaces may have no autostop depending on what the default was when they were created (unexpected?). I think I would expect them to all still have 24 hours. Probably caused by the same thing. Without having seen the code, my guess is maybe we have to go through and update autostop in the DB on all workspaces when the template default changes? |
cc @bpmct should we add this to the upcoming sprint? Possible 🥥 issue |
Relates to #15390 Currently when a user creates a workspace, their workspace's TTL is determined by the template's default TTL. If the Coder instance is AGPL, or if the template has disallowed the user from configuring autostop, then it is not possible to change the workspace's TTL after creation. Any changes to the template's default TTL only takes effect on _new_ workspaces. This PR modifies the behaviour slightly so that on AGPL Coder, or on enterprise when a template does not allow user's to configure their workspace's TTL, updating the template's default TTL will also update any workspace's TTL to match this value.
With #15761 being merged, when a template's TTL is modified, and users are unable to change their workspace's autostop, then workspaces using this template have their TTL modified. This doesn't have an effect on running workspaces though. As an example, if a workspace was started when autostop was 8 hours, and then the template admin decided to disable autostop, the running workspace still has the same 8 hour deadline. Only when the workspace is next started does this take effect. A question I have is do we want to modify a running workspace's deadline based on the changing TTL or do we leave that as is? My thoughts are that if the TTL is increased then there is no harm in extending the workspace's deadline, but I'm not sure if it is a good user experience to decrease a workspace's deadline when the TTL is decreased. @bpmct I feel like this might need product's perspective. |
I totally agree with you here. We should never allow a bulk change to decrease a living workspaces' autostop. Increasing is fine, but I am also totally OK if we just require an update for the changes to take effect. Will defer to your judgement here. Bulk workspace actions or CLIs can be used to update workspaces. |
Thanks! I think for now we should leave the running workspaces' deadline as is then. |
Relates to #15390 Currently when a user creates a workspace, their workspace's TTL is determined by the template's default TTL. If the Coder instance is AGPL, or if the template has disallowed the user from configuring autostop, then it is not possible to change the workspace's TTL after creation. Any changes to the template's default TTL only takes effect on _new_ workspaces. This PR modifies the behaviour slightly so that on AGPL Coder, or on enterprise when a template does not allow user's to configure their workspace's TTL, updating the template's default TTL will also update any workspace's TTL to match this value.
To reproduce:
I think the default autostop gets set on the workspace, but when you disable autostop it does not then remove it from the workspaces, and you cannot change it as a user either because autostop is disabled in this scenario.
The text was updated successfully, but these errors were encountered: