Skip to content

Commit ee7179d

Browse files
committed
Add notes/todos
1 parent 7d4f170 commit ee7179d

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
@@ -1213,9 +1213,12 @@ func (a *agent) Close() error {
12131213

12141214
// Close services before running shutdown script.
12151215
// TODO(mafredri): Gracefully shutdown:
1216+
// - Cancel startup script, if running
12161217
// - Close active SSH server connections
12171218
// - Close processes (send HUP, wait, etc.)
12181219

1220+
// TODO(mafredri): Only run shutdown script if the agent is 'ready'?
1221+
12191222
lifecycleState := codersdk.WorkspaceAgentLifecycleOff
12201223
if metadata, ok := a.metadata.Load().(agentsdk.Metadata); ok {
12211224
scriptDone := make(chan error, 1)
@@ -1254,6 +1257,7 @@ func (a *agent) Close() error {
12541257
// Set final state and wait for it to be reported because context
12551258
// cancellation will stop the report loop.
12561259
a.setLifecycle(ctx, lifecycleState)
1260+
// TODO(mafredri): What if the agent token is revoked, build outdated, etc.?
12571261
for s := range a.lifecycleReported {
12581262
if s == lifecycleState {
12591263
break

0 commit comments

Comments
 (0)