-
Notifications
You must be signed in to change notification settings - Fork 881
feat!: bump workspace activity by 1 hour #10704
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
Conversation
Will bump by ttl if crosses an autostart threshold
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about the additional complexity in the datbase query to perform the bump.
I'm also concerned that this behavioural change may be unexpected, so we should definitely document this new behaviour as well and sure it's called out in the release notes.
Personally, I would be more in favour of just unconditionally bumping the deadline 1 hour each time.
However, I'm not sure if this 'wrap-around' behaviour was a requested feature.
So approving with the above caveats.
-- relevant. If a past autostart is being passed in, | ||
-- that is a mistake by the caller. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review: not necessarily, this can happen due to a failed get from the template schedule store.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it would be the zero time. Let me clarify that I mean passing in a timestamp that is in the past, but above the zero time.
The wrap around behavior was the reason the ttl bump happened originally. I am unsure if it was reported by customers, but it was happening to @ammario enough for the original change. I feel putting it back to just the simple 1hr bump would land us where we are again right now. I agree it is a more complex query, which is unfortunate. I just see this as the easier solution if you are trying to solve the wrap around problem and keep activity bumps short (1h). |
What this does
Workspace activity will bump the workspace build deadline by 1 hour.
If the activity bump will cross an autostart threshold, then the bump amount will be the TTL instead. This is so if a workspace is active through the night (likely from an idle terminal), when the next morning comes, the workspace deadline will be bumped as if it autostarted that morning.
If
max_deadline
is set, it will not be bumped and honored from the original start.A suggestion would be to max
max_deadline < 24
hours to make sure workspaces are restarted every night to avoid this entirely.Closes https://github.com/coder/customers/issues/318