Skip to content

fix: avoid missed logs when streaming startup logs #8029

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

Merged
merged 12 commits into from
Jun 16, 2023
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
mafredri committed Jun 16, 2023
commit 0dcfd731ef39fc3c68ab0ebc9f06906a029fb473
3 changes: 2 additions & 1 deletion coderd/workspaceagents.go
Original file line number Diff line number Diff line change
Expand Up @@ -1628,9 +1628,10 @@ func (api *API) workspaceAgentReportLifecycle(rw http.ResponseWriter, r *http.Re
EOF: []bool{true},
OutputLength: 0,
})
return xerrors.Errorf("write EOF log entry", err)
return xerrors.Errorf("write EOF log entry: %w", err)
}, nil)
if err != nil {
logger.Warn(ctx, "failed to mark startup logs as complete", slog.Error(err))
// If this fails, we want the agent to keep trying so that the
// startup log is eventually marked as complete.
httpapi.InternalServerError(rw, err)
Expand Down