Skip to content

Commit 9fb2c7b

Browse files
committed
Add notes/todos
1 parent 797ffd1 commit 9fb2c7b

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

12241224
// Close services before running shutdown script.
12251225
// TODO(mafredri): Gracefully shutdown:
1226+
// - Cancel startup script, if running
12261227
// - Close active SSH server connections
12271228
// - Close processes (send HUP, wait, etc.)
12281229

1230+
// TODO(mafredri): Only run shutdown script if the agent is 'ready'?
1231+
12291232
lifecycleState := codersdk.WorkspaceAgentLifecycleOff
12301233
if metadata, ok := a.metadata.Load().(agentsdk.Metadata); ok {
12311234
scriptDone := make(chan error, 1)
@@ -1264,6 +1267,7 @@ func (a *agent) Close() error {
12641267
// Set final state and wait for it to be reported because context
12651268
// cancellation will stop the report loop.
12661269
a.setLifecycle(ctx, lifecycleState)
1270+
// TODO(mafredri): What if the agent token is revoked, build outdated, etc.?
12671271
for s := range a.lifecycleReported {
12681272
if s == lifecycleState {
12691273
break

0 commit comments

Comments
 (0)