Skip to content

Commit a57877a

Browse files
committed
Add notes/todos
1 parent e7ca1b2 commit a57877a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

agent/agent.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,9 +1318,12 @@ func (a *agent) Close() error {
13181318

13191319
// Close services before running shutdown script.
13201320
// TODO(mafredri): Gracefully shutdown:
1321+
// - Cancel startup script, if running
13211322
// - Close active SSH server connections
13221323
// - Close processes (send HUP, wait, etc.)
13231324

1325+
// TODO(mafredri): Only run shutdown script if the agent is 'ready'?
1326+
13241327
lifecycleState := codersdk.WorkspaceAgentLifecycleOff
13251328
if metadata, ok := a.metadata.Load().(agentsdk.Metadata); ok {
13261329
scriptDone := make(chan error, 1)
@@ -1359,6 +1362,7 @@ func (a *agent) Close() error {
13591362
// Set final state and wait for it to be reported because context
13601363
// cancellation will stop the report loop.
13611364
a.setLifecycle(ctx, lifecycleState)
1365+
// TODO(mafredri): What if the agent token is revoked, build outdated, etc.?
13621366
for s := range a.lifecycleReported {
13631367
if s == lifecycleState {
13641368
break

0 commit comments

Comments
 (0)